-
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
generic type inference for boolean literals fails #19896
Comments
confirmed on
|
// let z: false = false; Isn't this a compiler bug, letting you use 'false' as a type rather than 'boolean'? |
typescript permits boolean literals as type declarators. this is particularly relevant in React development, since |
@mhegazy what is the inferred suggestion here? |
Seems working fine on 3.9.2. |
Just looking at old issues; this was fixed back by #27042. |
TypeScript Version: 2.6.1
Code
Expected behavior:
z
andx
should be of the same typeActual behavior:
x
is being inferred asboolean
instead offalse
The text was updated successfully, but these errors were encountered: