warn_unreachable false positive when reassigning in loop #15917
Labels
bug
mypy got something wrong
topic-reachability
Detecting unreachable code
topic-type-narrowing
Conditional type narrowing / binder
Bug Report
To Reproduce
-Run this code with
warn_unreachable
enabled:(Mypy playground)
Expected Behavior
No errors.
Actual Behavior
(this is wrong, the script indeed hits line 8 and prints
Not None
)Your Environment
mypy.ini
(and other config files):warn_unreachable = true
The text was updated successfully, but these errors were encountered: