Added test case for #7250, which was fixed by the same fix for #7141.

This commit is contained in:
Eric Traut 2024-05-21 00:02:51 -07:00
parent 39962012cb
commit e4e48b9d26

View File

@ -7,6 +7,7 @@ from typing import (
Generic,
Literal,
ParamSpec,
Protocol,
TypeVar,
Callable,
TypeVarTuple,
@ -203,3 +204,15 @@ test_11(test_11, func3, 123)
# This will generate an error, but it should not crash or cause an infinite loop.
test_11(test_11, test_11, func3, 123)
class Proto1(Protocol):
def __call__(self, a: T, b: T) -> T: ...
def func4(a: T, b: T) -> T:
return a
def test_12(p: Proto1) -> Proto1:
return p(func4, func4)