Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number literal unions are resolved as String #273

Closed
Schahen opened this issue Apr 29, 2020 · 1 comment
Closed

Number literal unions are resolved as String #273

Schahen opened this issue Apr 29, 2020 · 1 comment
Labels
unusable-code kotlin code is generated, can be compiled but actually is unusable
Milestone

Comments

@Schahen
Copy link
Contributor

Schahen commented Apr 29, 2020

interface Foo {
  primeSeed?: 2 | 3 | 5 | 7 | 11 | 13;
}

is converted to:

external interface Foo {
    var primeSeed: String? /* 2 | 3 | 5 | 7 | 11 | 13 */
        get() = definedExternally
        set(value) = definedExternally
}

while actually we expect Number

@Schahen Schahen added the unusable-code kotlin code is generated, can be compiled but actually is unusable label Apr 29, 2020
@Schahen Schahen changed the title Number literal unions a resolved as String Number literal unions are resolved as String Apr 29, 2020
@Schahen Schahen added this to the 0.5.1 milestone May 28, 2020
@Schahen
Copy link
Contributor Author

Schahen commented Jun 3, 2020

Keep in mind that numeric literal is not necessarily integer

Schahen added a commit that referenced this issue Jun 3, 2020
@Schahen Schahen closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unusable-code kotlin code is generated, can be compiled but actually is unusable
Projects
None yet
Development

No branches or pull requests

1 participant