-
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
Inference to unions containing void
behave differently from 4.2 on
#42786
Comments
void
behave differently from 4.2 onvoid
behave differently from 4.2 on
Likely involves the changes from #42353, and I have theories of what we probably do, but @ahejlsberg will surely have a better idea. |
Yeah, this one is an effect of us now reducing We've had many discussions about our strange |
@ahejlsberg is that an option? Is it just a matter of special-casing how we invoke literal type reduction? That might be worth it. |
Yes, it's an option and it isn't particularly hard to implement. We'd just make the |
Bug Report
🔎 Search Terms
void, union, user-defined type guard
🕗 Version & Regression Information
v4.2.0-dev.20210207. It stayed this way in 4.3.0-dev.20210211
void
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Compile-time error.
foo
isstring | undefined
🙂 Expected behavior
No compile-time error.
foo
isstring
The text was updated successfully, but these errors were encountered: