Skip to content

Incorrect type narrowing for tuples based on sequence pattern matching #7117

@erictraut

Description

@erictraut

The following code demonstrates the bug:

def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]):
    match val:
        case (x, y):
            assert_type(val, tuple[str, str] | tuple[int, int])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions