Skip to content

Commit 98881d2

Browse files
authored
Add regression test for expand type -> simplified union crash (#15864)
See #13431 Authored by ilevkivskyi
1 parent 117b914 commit 98881d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test-data/unit/check-callable.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,3 +587,14 @@ class C(B):
587587
def f(self, x: int) -> C: ...
588588
class B: ...
589589
[builtins fixtures/classmethod.pyi]
590+
591+
[case testCallableUnionCallback]
592+
from typing import Union, Callable, TypeVar
593+
594+
TA = TypeVar("TA", bound="A")
595+
class A:
596+
def __call__(self: TA, other: Union[Callable, TA]) -> TA: ...
597+
a: A
598+
a() # E: Missing positional argument "other" in call to "__call__" of "A"
599+
a(a)
600+
a(lambda: None)

0 commit comments

Comments
 (0)