File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3035,6 +3035,21 @@ def id(x: V) -> V:
30353035reveal_type(dec(id, id)) # N: Revealed type is "def [T] (T`1) -> Tuple[T`1, T`1]"
30363036[builtins fixtures/tuple.pyi]
30373037
3038+ [case testInferenceAgainstGenericSecondary]
3039+ from typing import TypeVar, Callable, List
3040+
3041+ S = TypeVar('S')
3042+ T = TypeVar('T')
3043+ U = TypeVar('U')
3044+
3045+ def dec(f: Callable[[List[T]], List[int]]) -> Callable[[T], T]: ...
3046+
3047+ @dec
3048+ def id(x: U) -> U:
3049+ ...
3050+ reveal_type(id) # N: Revealed type is "def (builtins.int) -> builtins.int"
3051+ [builtins fixtures/tuple.pyi]
3052+
30383053[case testInferenceAgainstGenericEllipsisSelfSpecialCase]
30393054# flags: --new-type-inference
30403055from typing import Self, Callable, TypeVar
You can’t perform that action at this time.
0 commit comments