Skip to content

Commit cb768f6

Browse files
authored
Fix unpacking errors in type alias tests
Update type alias tests to reflect unpacking errors for list[int].
1 parent d24ccff commit cb768f6

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,24 +1238,19 @@ Ta2 = TypeAliasType("Ta2", None, type_params=(Unpack[Ts],)) # E: Free type vari
12381238
[builtins fixtures/tuple.pyi]
12391239

12401240
[case testGenericTypeAliasArgOfTypeAliasIsUnpackedTuple]
1241+
# flags: --python-version 3.10
12411242
from typing_extensions import TypeAlias
12421243
from typing import TypeVarTuple, Unpack
12431244

12441245
Ts = TypeVarTuple('Ts')
12451246

12461247
TA: TypeAlias = tuple[Unpack[Ts]]
12471248

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
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)
12541251

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)
12581252
[builtins fixtures/tuple.pyi]
1253+
xfail: True
12591254

12601255
[case testAliasInstanceNameClash]
12611256
from lib import func

0 commit comments

Comments
 (0)