Skip to content

Commit b56d7ae

Browse files
committed
Add regression test for recursive type alias with varying ParamSpec args
(#21123)
1 parent 24ca4d5 commit b56d7ae

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test-data/unit/check-python312.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,3 +2280,14 @@ class D[*Ts](Generic[Unpack[Us]]): # E: Generic[...] base class is redundant \
22802280
# E: Can only use one type var tuple in a class def
22812281
pass
22822282
[builtins fixtures/tuple.pyi]
2283+
2284+
[case testPEP695RecursiveTypeAliasParamSpecConcatenate]
2285+
from typing import Callable
2286+
from typing_extensions import Concatenate
2287+
2288+
type A[**P] = Callable[[Callable[P, None]], A[Concatenate[int, P]]]
2289+
2290+
def foo[**P](x: A[P]) -> None:
2291+
reveal_type(x) # N: Revealed type is "def (def (*P.args, **P.kwargs)) -> ..."
2292+
[builtins fixtures/type.pyi]
2293+
[typing fixtures/typing-full.pyi]

0 commit comments

Comments
 (0)