Skip to content

Commit f921b76

Browse files
authored
Add test cases for TypeAlias and TypeVarTuple
1 parent d66d09d commit f921b76

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test-data/unit/check-python311.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,15 @@ def exc_name() -> None:
321321
except* RuntimeError as e:
322322
e = fn_exc(e)
323323
[builtins fixtures/exception.pyi]
324+
325+
[case testGenericTypeAliasArgOfTypeAliasIsUnpackedTuple]
326+
from typing_extensions import TypeAlias
327+
from typing import TypeVarTuple, Unpack
328+
329+
Ts = TypeVarTuple('Ts')
330+
TA: TypeAlias = tuple[Unpack[Ts]]
331+
332+
# v1: TA[*list[int]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
333+
334+
v2: TA[Unpack[list[int]]] # E: "list[int]" cannot be unpacked (must be tuple or TypeVarTuple)
335+
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)