-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Proposal: 'always' type #13804
Comments
The suggestion is simply to add that line to lib.d.ts? |
It would be ideal if it was built-in rather than a type alias, so that it didn't get expanded to |
Some elaboration of the desired use of this type would be helpful. What's it for? Why would I use it? What would the documentation say about it? |
@RyanCavanaugh #10715 has a good detailed description of why this is desirable. |
Is this a duplicate then? |
Yes, modulo a suggestion of what to call this type. |
We have a
never
type representing the bottom of the type lattice... what about having a built-in corresponding "top" type? Essentially:A variable of type
always
can be assigned any value, but nothing is known about it aside from the fact that it exists.any
doesn't fit the bill, because we can assign anany
to any other type and access arbitrary properties on it (it behaves like bothnever
andalways
depending on the context).The text was updated successfully, but these errors were encountered: