mypy incorrectly identifies statements as unreachable when matching against constants #12545
Labels
bug
mypy got something wrong
topic-match-statement
Python 3.10's match statement
topic-reachability
Detecting unreachable code
Bug Report
When using a
match
statement withcase
s that are constants, it incorrectly identifies the later cases as being unreachable.To Reproduce
I have the following file structure:
In
consts.py
:In
test.py
:Expected Behavior
mypy
succeeds as the code is reachable.Actual Behavior
Running
mypy --warn-unreachable .\util\test.py
gives:Your Environment
--warn-unreachable
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: