Skip to content

Commit 72802dd

Browse files
authored
Add a test
1 parent 6f0c0b5 commit 72802dd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test-data/unit/check-typevar-tuple.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,3 +2487,22 @@ class C(Generic[P, R]):
24872487
c: C[int, str] # E: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int"
24882488
reveal_type(c.fn) # N: Revealed type is "def (*Any, **Any)"
24892489
[builtins fixtures/tuple.pyi]
2490+
2491+
[case testSubtypingWithUnpackAndTuples]
2492+
# This test is convoluted as there is special casing to get past.
2493+
# (for instance, passing a keyword argument is necessary)
2494+
import operator
2495+
from collections.abc import Callable
2496+
from typing_extensions import TypeVarTuple, Unpack
2497+
2498+
Ts = TypeVarTuple("Ts")
2499+
2500+
def run(func: Callable[[Unpack[Ts]], None], *args: Unpack[Ts], some_kwarg: None) -> None:
2501+
return func(*args)
2502+
2503+
def foo() -> None:
2504+
raise NotImplementedError
2505+
2506+
run(foo, some_kwarg=None)
2507+
operator.call(run, foo, some_kwarg=None)
2508+
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)