-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Incorrect discriminated union narrowing following exhaustive if/else #9246
Comments
This is by design. It is an effect of #8548. |
This one will be tricky to fix. We basically have two conflicting goals: Sometimes we want to use control flow analysis to prove exhaustiveness, at other times we want a convenient way to defeat the exhaustiveness (e.g. when writing defensive code or when control flow analysis can't see the entire picture). Part of the problem is that we can't always see the "connectedness" of multiple type guards. In a |
Expected: No error
Actual:
The text was updated successfully, but these errors were encountered: