Skip to content

[1.20 regression] Mypy incorrectly marks a match case as unreachable #21189

@rchen152

Description

@rchen152

I noticed this issue while updating the typing conformance tests. On this code snippet, which is taken from the tuples_type_compat conformance test, mypy 1.19.1 behaves correctly (errors on exactly one assert_type in each match case, showing that it infers one of the two acceptable types in each case), whereas mypy 1.20.0 incorrectly marks the code in the last match case as unreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions