-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Unresolved generic type arguments end up in type declarations since 5.7.2 #61338
Comments
If you have a version range, could you try https://www.npmjs.com/package/every-ts to bisect? |
Simpler way to reproduce: function wrapper<T>(value: T) {
return {
get g() { return value; },
}
}
export const w = wrapper(0) Produces: export declare const w: {
readonly g: T;
}; Will have a look today. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🔎 Search Terms
unresolved, undefined, declarations
🕗 Version & Regression Information
In a project, I have a relatively complex set of generic types to be able to declare some values that get expanded and merged with defaults at runtime, while exposing that behavior in the type system. This seems to be complex enough that the semantic highlighting in VSCode regularly breaks in that file: https://github.com/zwave-js/zwave-js/blob/133172125d4148ea6e9e92a059b4325862ff6dd7/packages/cc/src/lib/Values.ts
Until TS 5.6.3, this code
would result in a type definition like this:
Since 5.7.2, this is what gets generated. Note that
ValueIDBase
andTBlueprint
are generics type arguments used in the transformation that aren't defined in the output file, so the entire types of themeta
andoptions
properties effectively resolve toany
. It seems that somewhere along the line, TS just gives up resolving:⏯ Playground Link
No response
💻 Code
No response
🙁 Actual behavior
see above
🙂 Expected behavior
see above
Additional information about the issue
I found another issue that might be related, but I'm not familiar enough with the details to know:
#60864
The text was updated successfully, but these errors were encountered: