-
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
Partial type fails to narrow in spite of check for undefined II #31495
Comments
It can be reproduced on playground enabling Probably related to #9998. |
Narrowing by discriminant (which is happening at |
It may be a design limitation, but it certainly cannot be working as intended - unless the intention is to surprise the user! |
I am facing the same issue. |
+1, example |
The examples in this issue are fixed in 3.8. I don't know what change fixed them, though. |
@threehams, you're right: it's been fixed. Thanks. |
TypeScript Version: 3.4.0
Search Terms: Partial switch
Code
Expected behavior:
No compiler error
Actual behavior:
The compiler complains of
value.array
being undefinedPlayground Link:
Not able to reproduce on the playground. I think this is a bug in 3.4.
Related Issues:
This is another version of the bug reported here: #29496
The text was updated successfully, but these errors were encountered: