-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Type narrowing not working in else statements #52272
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
Duplicate of #43026. |
I’m not sure #43026 (comment) applies here since that involves a |
Fairly certain it does apply. When type Foo = (
| { name: "a"; isAorB: true }
| { name: "b"; isAorB: true }
| { name: "c"; isC: true }
) |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
Playground link with relevant code
💻 Code
🙁 Actual behavior
TypeScript failed to recognize
foo.isC
.🙂 Expected behavior
TypeScript recognize that
foo.isC == true
.The text was updated successfully, but these errors were encountered: