Skip to content

Commit 2676b24

Browse files
authored
Fix unpacking errors in TypeAlias tests
Updated test cases for TypeAlias unpacking in Python.
1 parent 0c0d582 commit 2676b24

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test-data/unit/check-type-aliases.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,8 +1246,9 @@ Ts = TypeVarTuple('Ts')
12461246
TA: TypeAlias = tuple[Unpack[Ts]]
12471247

12481248
# For Python 3.10, error: Invalid syntax
1249-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1250-
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1249+
# For other Python, error: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1250+
v1: TA[*list[int]]
1251+
v2: TA[Unpack[list[int]]]
12511252
[builtins fixtures/tuple.pyi]
12521253

12531254
[case testAliasInstanceNameClash]

0 commit comments

Comments
 (0)