You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False positive: unreachable case when using Literal #17328
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: Occupancymatchocc:
case (1, 5):
print(1)
case (1, 6):
print(2) # Unreachable error
Activity
Merge branch 'pythongh-17328-match-tuple-negative-narrowing' into pyt…
Fix negative narrowing of tuples in match statement (python#17817)