Skip to content

Commit e061414

Browse files
committed
Add additional test
1 parent 967be77 commit e061414

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test-data/unit/check-inference.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,3 +4149,19 @@ class Foo:
41494149
else:
41504150
self.qux = {} # E: Need type annotation for "qux" (hint: "qux: dict[<type>, <type>] = ...")
41514151
[builtins fixtures/dict.pyi]
4152+
4153+
[case testConstraintSolvingFailureShowsCorrectArgument]
4154+
from typing import Callable, TypeVar
4155+
4156+
T1 = TypeVar('T1')
4157+
T2 = TypeVar('T2')
4158+
def foo(
4159+
a: T1,
4160+
b: T2,
4161+
c: Callable[[T2], T2],
4162+
) -> tuple[T1, T2]: ...
4163+
4164+
def bar(y: float) -> float: ...
4165+
4166+
foo(1, None, bar) # E: Cannot infer type argument to type parameter "T2" of "foo"
4167+
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)