Skip to content

Commit d24ccff

Browse files
authored
Update check-type-aliases.test with new cases
Add tests for type alias unpacking with lists.
1 parent bc3db3d commit d24ccff

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,16 @@ Ts = TypeVarTuple('Ts')
12451245

12461246
TA: TypeAlias = tuple[Unpack[Ts]]
12471247

1248-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1249-
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1248+
v1: TA[*list[int]]
1249+
v2: TA[Unpack[list[int]]]
1250+
1251+
[out-python3.10]
1252+
main:8: error: Invalid syntax
1253+
main:9: error: Invalid syntax
1254+
1255+
[out]
1256+
main:8: error: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1257+
main:9: error: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
12501258
[builtins fixtures/tuple.pyi]
12511259

12521260
[case testAliasInstanceNameClash]

0 commit comments

Comments
 (0)