Skip to content

Commit

Permalink
Add regression test for expand type -> simplified union crash (#15864)
Browse files Browse the repository at this point in the history
See #13431

Authored by ilevkivskyi
  • Loading branch information
hauntsaninja authored Aug 13, 2023
1 parent 117b914 commit 98881d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test-data/unit/check-callable.test
Original file line number Diff line number Diff line change
Expand Up @@ -587,3 +587,14 @@ class C(B):
def f(self, x: int) -> C: ...
class B: ...
[builtins fixtures/classmethod.pyi]

[case testCallableUnionCallback]
from typing import Union, Callable, TypeVar

TA = TypeVar("TA", bound="A")
class A:
def __call__(self: TA, other: Union[Callable, TA]) -> TA: ...
a: A
a() # E: Missing positional argument "other" in call to "__call__" of "A"
a(a)
a(lambda: None)

0 comments on commit 98881d2

Please sign in to comment.