Skip to content

Commit c64d00b

Browse files
committed
Add test with inheritance
1 parent e093f64 commit c64d00b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-data/unit/check-functions.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,4 +3501,12 @@ def key2(x: int) -> None:
35013501
@decorator2(key2) # E: Argument 1 has incompatible type "Callable[[Arg(int, 'y')], Coroutine[Any, Any, None]]"; expected "Callable[[Arg(int, 'x')], Awaitable[None]]"
35023502
async def foo2(y: int) -> None:
35033503
...
3504+
3505+
class Parent:
3506+
def method_without(self) -> "Parent": ...
3507+
def method_with(self, param: str) -> "Parent": ...
3508+
3509+
class Child(Parent):
3510+
method_without: Callable[["Child"], "Child"]
3511+
method_with: Callable[["Child", str], "Child"] # E: Incompatible types in assignment (expression has type "Callable[[str], Child]", base class "Parent" defined the type as "Callable[[Arg(str, 'param')], Parent]")
35043512
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)