-
Notifications
You must be signed in to change notification settings - Fork 12.8k
narrowing is lost at creating literals #21436
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
Comments
It's extremely strange to me that quick info seems to narrow |
@DanielRosenwasser I believe you get the correct narrowing behavior with |
@ahejlsberg You left a comment inside // If the contextual type is a union containing both of the 'true' and 'false' types we
// don't consider it a literal context for boolean literals. is there a motivating example for this, or can the exception for booleans be removed? |
@weswigham As I recall it had to do with destructuring an object literal that specifies the value |
the following works tho:
The text was updated successfully, but these errors were encountered: