Skip to content

Commit ea00101

Browse files
authored
Surface false positive hidden by issue with fixtures (#21162)
1 parent e5cd1f9 commit ea00101

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test-data/unit/check-python310.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ def f2(x: Mapping[str, str] | Sequence[str] | str) -> None:
681681
case [*_]:
682682
reveal_type(x) # N: Revealed type is "typing.Sequence[builtins.str]"
683683
case _:
684-
reveal_type(x) # N: Revealed type is "builtins.str"
684+
# TODO: this should be str
685+
reveal_type(x) # E: Statement is unreachable
685686

686687
def f2_rest(x: Mapping[str, str] | Sequence[str] | str) -> None:
687688
match x:
@@ -690,8 +691,9 @@ def f2_rest(x: Mapping[str, str] | Sequence[str] | str) -> None:
690691
case [*_]:
691692
reveal_type(x) # N: Revealed type is "typing.Sequence[builtins.str]"
692693
case _:
693-
reveal_type(x) # N: Revealed type is "builtins.str"
694-
[builtins fixtures/dict.pyi]
694+
# TODO: this should be str
695+
reveal_type(x) # E: Statement is unreachable
696+
[builtins fixtures/primitives.pyi]
695697

696698
[case testMatchMappingPatternNarrowingAny]
697699
# flags: --strict-equality --warn-unreachable

0 commit comments

Comments
 (0)