-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Change of binder behavior whan narrowing to unrelated type #18967
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
In #18707 I changed things such that narrowing to I would be fine to extract that if it's a good idea. |
Marking this code unreachable is a possible solution, but it may cause undesired behavior in other cases. Another possible option would be to replace |
I will double-check (superficially good) fallout in #18972 later today or tomorrow. |
The behavior in this example was changed in #18538:
In the past, the code after
isinstance
was silently unchecked. Now the inferred type isNever
, which will likely generate false positives. Neither behavior is great, but users may consider the switch from false negatives to false positives to be a regression. I'm not sure what we should do here. If we'd allow variables to be redefined freely, there would be no issue.cc @ilevkivskyi who authored the PR that changed the behavior
The text was updated successfully, but these errors were encountered: