basedmypy
basedmypy copied to clipboard
inferred overload return types don't work with generics in some cases
@overload
def foo(value: str) -> int: ...
@overload
def foo[T](value: T) -> T: ...
def foo[T](value: T | str):
if isinstance(value, str):
return 1
return value # Incompatible return value type (got "T@foo", expected "int | T@foo")
duplicate of #385?
dont think so, this issue seems to have been introduced in the latest release
i think it is the same underlying issue, i'm going to merge it