-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TS 3.6 generates broken types references in .d.ts files #33395
Comments
Playground also doesn't generate .d.ts files for display yet =x |
Errr, far as I can tell, that error in /// <reference types="lodash" />
/// <reference types="lodash/common/common" /> you get no errors. If you compile this: /// <reference types="lodash/common/common" />
/// <reference types="lodash" /> you get all the errors - the errors are seemingly dependent on the order the files are found in! |
Here's a minimal repro: namespace ns {
interface Function<T extends (...args: any) => any> {
throttle(): Function<T>;
}
interface Function<T> {
unary(): Function<() => ReturnType<T>>;
}
} this does: namespace ns {
interface Function<T> {
unary(): Function<() => ReturnType<T>>;
}
interface Function<T extends (...args: any) => any> {
throttle(): Function<T>;
}
} 🤦♀ |
#20883 〰️✊〰️ |
@mattmccutchen you from 2018 win for having opened #23909 which dupes this first. Ya gotta stick to your guns 😛 |
What about the references included in the emitted .d.ts file? It doesn't seem like these should be there, and it was working fine with TS 3.5. |
They not strictly needed in this case, since |
@weswigham Will the fix be included in an eventual 3.6.4 release? |
That would be up to @DanielRosenwasser, otherwise it's 3.7 bound. |
@typescript-bot cherry-pick this to release-3.6 |
@DanielRosenwasser pls - the PR's thataways -----> #33426 |
Make the bot smarter |
TypeScript Version: 3.6.3
Search Terms: reference
Code
Expected behavior:
The resulting .d.ts file should look like this:
Actual behavior:
Instead, since TS 3.6, this is what is generated:
This breaks the types for consumers of this .d.ts file:
Playground Link: The playground doesn't have TS 3.6 yet. ¯\_(ツ)_/¯
Related Issues: I don't think so.
The text was updated successfully, but these errors were encountered: