-
Notifications
You must be signed in to change notification settings - Fork 2.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
TypeScript never type #113
Comments
Docs for the Never Type live here : https://basarat.gitbooks.io/typescript/content/docs/types/never.html 🌹 |
The annotation needs to be explicit now : fc3b4ca 🌹 The default inference is now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PR : microsoft/TypeScript#8652
Issue : microsoft/TypeScript#3076
Concept : https://en.wikipedia.org/wiki/Bottom_type
Add
bottom.md
in tips.Use case
Confusion with
void
void
is a Unit.never
is a falsum.A function that returns nothing returns a Unit
void
. However a function that never returns (or always throws) returnsnever
.void
is something that can be assigned (wihout strictNullChecking) butnever
cannever
be assigned to anything other thannever
.The text was updated successfully, but these errors were encountered: