Skip to content

Commit 08235af

Browse files
authored
Clarify unpacking expectations in type alias tests
Update comments to clarify expectations for unpacking lists in type aliases.
1 parent d4f0e67 commit 08235af

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,9 @@ from typing import TypeVarTuple, Unpack
12451245
Ts = TypeVarTuple('Ts')
12461246
TA: TypeAlias = tuple[Unpack[Ts]]
12471247

1248-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1249-
# python3.10: Invalid syntax; you likely need to run mypy using Python 3.11 or newer
1248+
# Only "Test suite with py310-ubuntu, mypyc-compiled" expects: Invalid syntax; you likely need to run mypy using Python 3.11 or newer
1249+
# The other tests expects: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1250+
# v1: TA[*list[int]]
12501251

12511252
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
12521253
[builtins fixtures/tuple.pyi]
@@ -1259,8 +1260,9 @@ from typing import TypeVarTuple, Unpack
12591260
Ts = TypeVarTuple('Ts')
12601261
TA: TypeAlias = tuple[Unpack[Ts]]
12611262

1262-
v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1263-
# python3.10: Invalid syntax
1263+
# Only "Test suite with py310-ubuntu, mypyc-compiled" expects: Invalid syntax
1264+
# The other tests expects: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
1265+
# v1: TA[*list[int]]
12641266

12651267
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
12661268
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)