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

Union type unrolling is broken when it's aliased in a referenced file #73

Closed
Schahen opened this issue Jul 16, 2019 · 1 comment
Closed

Comments

@Schahen
Copy link
Contributor

Schahen commented Jul 16, 2019

Following code:

/* file1.d.ts */
declare class Foo {}

type Key = Key2 | number;
type Key2 = string | Foo;

/* file2.d.ts */
/// <reference path="file1.d.ts" />

declare function barKey(a: Key|number);

Is translated to:

/* file2.kt */
external fun barKey(a: Key): Unit
external fun barKey(a: Number): Unit

While actually what I expect to see (and what happens when alias is in the same file):

external fun barKey(a: String): Unit
external fun barKey(a: Foo): Unit
external fun barKey(a: Number): Unit
@Schahen Schahen added the bug label Jul 16, 2019
Schahen added a commit that referenced this issue Jul 19, 2019
@Schahen
Copy link
Contributor Author

Schahen commented Jul 19, 2019

fixed in 0.0.12

@Schahen Schahen closed this as completed Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant