Bug Report
input: tuple[list, list]
match input:
case _, []:
print(1)
case [], _:
print(2)
case _:
print(3)
This is perfectly valid at runtime, but mypy warns about unreachable at print(2). reveal_type shows tuple[Never, list].
To Reproduce
https://mypy-play.net/?mypy=master&python=3.12&flags=strict%2Cwarn-unreachable&gist=772131f18fb17abb981f7485732713e7
Expected Behavior
Should not error
Actual Behavior
main.py:6: error: Statement is unreachable [unreachable]
main.py:8: note: Revealed type is "tuple[Never, builtins.list[builtins.int]]"
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used:
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini (and other config files):
- Python version used:
Bug Report
This is perfectly valid at runtime, but mypy warns about
unreachableatprint(2).reveal_typeshowstuple[Never, list].To Reproduce
https://mypy-play.net/?mypy=master&python=3.12&flags=strict%2Cwarn-unreachable&gist=772131f18fb17abb981f7485732713e7
Expected Behavior
Should not error
Actual Behavior
Your Environment
mypy.ini(and other config files):