Skip to content

Commit 5e3558e

Browse files
committed
Add test case
1 parent 3d37c29 commit 5e3558e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test-data/unit/check-python310.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,21 @@ match m:
770770
reveal_type(j) # N: Revealed type is "builtins.int"
771771
[builtins fixtures/tuple.pyi]
772772

773+
[case testMatchSequencePatternCaptureNamedTuple]
774+
from typing import NamedTuple
775+
776+
class N(NamedTuple):
777+
x: int
778+
y: str
779+
780+
a = N(1, "a")
781+
782+
match a:
783+
case [x, y]:
784+
reveal_type(x) # N: Revealed type is "builtins.int"
785+
reveal_type(y) # N: Revealed type is "builtins.str"
786+
[builtins fixtures/tuple.pyi]
787+
773788
[case testMatchClassPatternCaptureGeneric]
774789
from typing import Generic, TypeVar
775790

0 commit comments

Comments
 (0)