-
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
Discussion about typeof navigation #19441
Comments
This is already possible: let c3: (typeof o)["C"]["prototype"]; See #11929 for more details. |
You learn me something, but that doesn't change the navigation: you need to relay on variable navigation. |
I'm afraid I don't understand what you're asking for. If |
Additionally, if you want |
Yes, I think it could only work for object properties type or module properties type. |
Maybe this feature is confusing for users, so I close the request. |
TypeScript Version: 2.5.3
Code
Expected behavior:
(typeof o).C
inc3
produces an error.For now, typeof can navigate to variable and properties only, not types.
It would be great to be able to continue navigate types after a variable casting. So,
(typeof o).C
andtypeof o.C.prototype
will produce the same type result.I prefer
(typeof o).C
of course.Actual behavior:
let c3:(typeof o).C;
hates parenthesisThe text was updated successfully, but these errors were encountered: