Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Default value is erased in generated code #36

Description

@ifropc

Having the following code:

@JsExport
class Tester {
  fun test(f: String = "default value"): String {
    return f
  }
}

Will give this ts output:

class Tester {
    constructor();
    test(f?: string): string;
}

Preserving default value. However, using KustomExport on the same code:

@KustomExport
class Tester {
  fun test(f: String = "default value"): String {
    return f
  }
}

Will generate following kotlin code:

public fun test(f: String): String {
    val result = common.test(
        f = f,
    )
    return result
}

As a result, produced typescript definitions have mandatory parameter f:

class Tester {
    constructor();
    test(f: string): string;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions