-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Strong mode analyzer inconsistent about when types must match #30385
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
For the record, I would have expected an error in both cases. |
You've asked me about this before. :) Our previous discussion of which led to these two issues being filed: Strong mode makes implicit downcasts an error when it can immediately prove that the cast will fail. It's not smart enough to track the fact that The |
Why would we not make implicit downcasts an error in general? They're not sound, right? I thought the point was to be sound. |
So as @leafpetersen said, you can turn off implicit casts, that's |
removing implicit downcasts is now tracked in #31410 |
Consider this code:
Why are these different?
The text was updated successfully, but these errors were encountered: