Closed
Description
Bug Report
There are similar bug reports, but I'm not clear if any of them are the same cause or not. When using a Literal in the match statement, I get unreachable errors. The error doesn't occur if the Literal
is replaced with int
.
To Reproduce
Occupancy = tuple[Literal[1], int]
occ: Occupancy
match occ:
case (1, 5):
print(1)
case (1, 6):
print(2) # Unreachable error
Your Environment
- Mypy version used: 1.10
- Mypy command-line flags:
--warn-unreachable
- Python version used: 3.12