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

.d.ts export not properly handling recursive type bounds #2241

Open
mor-n4 opened this issue Oct 27, 2021 · 1 comment
Open

.d.ts export not properly handling recursive type bounds #2241

mor-n4 opened this issue Oct 27, 2021 · 1 comment
Labels

Comments

@mor-n4
Copy link
Contributor

mor-n4 commented Oct 27, 2021

Because the .d.ts export replaces wildcards by their explicit or implicit upper bound and does not yet have special handling for cycles, it can run into problems in case of recursive type bounds.

To reproduce (leads to invalid output):

class G0<T extends G0<T>> {}
let g0: G0<?>;

Leads to exception:

class G1<T extends G1<?>> {}

And similarly:

class A {}
class G2<T0 extends A,T1 extends G2<T0,?>> {}

Closely related, even this leads to invalid output (missing substitution):

class H<T> {}
class G3<T0, T1 extends H<T0>> {}
let g0: G3<string, ?>;
@mor-n4 mor-n4 added the bug label Oct 27, 2021
@mor-n4
Copy link
Contributor Author

mor-n4 commented Oct 27, 2021

Note: an early experimental implementation is on branch postponed-GH-2241 (incomplete!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant