-
Notifications
You must be signed in to change notification settings - Fork 232
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
The display of types #19
Comments
type n = Resolve<number> // number
type s42 = Resolve<"42"> // "42" How is that even possible? Ahah I mean |
It is surprising, isn't it? One clue is that type K = keyof number;
// ^? type K = "toString" | "toFixed" | "toExponential" | ... But still, I think this must be special-cased in the TypeScript compiler. Especially in the case of a literal type, the result is much more specific than you'd expect. |
I think I found something: microsoft/TypeScript#12447 |
The display of types
Effective TypeScript: The display of types
https://effectivetypescript.com/2022/02/25/gentips-4-display/
The text was updated successfully, but these errors were encountered: