Skip to content

Commit 8b23cf0

Browse files
committed
Add a testcase
1 parent 59f8e25 commit 8b23cf0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,3 +2628,19 @@ def fn(f: Callable[[*tuple[T]], int]) -> Callable[[*tuple[T]], int]: ...
26282628
def test(*args: Unpack[tuple[T]]) -> int: ...
26292629
reveal_type(fn(test)) # N: Revealed type is "def [T] (T`1) -> builtins.int"
26302630
[builtins fixtures/tuple.pyi]
2631+
2632+
[case testConstraintsIncludeTupleFallback]
2633+
from typing import Generic, TypeVar
2634+
from typing_extensions import TypeVarTuple, Unpack
2635+
2636+
T = TypeVar("T")
2637+
Ts = TypeVarTuple("Ts")
2638+
_FT = TypeVar("_FT", bound=type)
2639+
2640+
def identity(smth: _FT) -> _FT:
2641+
return smth
2642+
2643+
@identity
2644+
class S(tuple[Unpack[Ts]], Generic[T, Unpack[Ts]]):
2645+
def f(self, x: T, /) -> T: ...
2646+
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)