Closed
Description
Example:
from typing import Callable, Union, Any, overload, Protocol
class DCall(Protocol):
def __call__(self, arg: Union[int, str]) -> None:
...
class D:
def __getattr__(self, attr: str) -> DCall:
# This method might contain something like during runtime:
# if attr == '__call__':
# return some_func
# assert False
...
def dec_d(f: Callable[..., Any]) -> D:
return D()
@overload
def f_d(arg: int) -> None: ...
@overload
def f_d(arg: str) -> None: ...
@dec_d
def f_d(arg: Union[int, str]) -> None: ...
Outputs:
out/ex.py:18: error: "D" not callable
This happens here:
Lines 510 to 520 in 4f59ca4