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
4.9 regression with in
operator: object is incorrectly narrowed to never
#50954
Comments
This is an effect of #50666. The error in the second example looks correct. The type However, we do have an issue in the first example. The |
Couldnβt this be a problem for feature tests? i.e. testing for existence of methods or properties that are always-present according to the types, but the program wants to gracefully degrade if the browser doesnβt support them. Thatβs what I assumed the |
Well, there's sort of a gray area when it comes to non-optional properties of type |
Hmm, turns out our compiler itself actually contains code that depends on narrowing based on |
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
I've reduced it down to this:
The text was updated successfully, but these errors were encountered: