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:
3035
3035
reveal_type(dec(id, id)) # N: Revealed type is "def [T] (T`1) -> Tuple[T`1, T`1]"
3036
3036
[builtins fixtures/tuple.pyi]
3037
3037
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
+
3038
3053
[case testInferenceAgainstGenericEllipsisSelfSpecialCase]
3039
3054
# flags: --new-type-inference
3040
3055
from typing import Self, Callable, TypeVar
You can’t perform that action at this time.
0 commit comments