Closed
Description
I have the follwoing stub file (test.pyi
):
from typing import overload
@overload
def func(
param: None = ...
) -> int: ...
@overload
def func(
param: int = ...
) -> str: ...
When I run mypy test.pyi
, mypy shows the following error:
test.pyi:4: error: Overloaded function signatures 1 and 2 overlap with incompatible return types
The parameter param
clearly has two different types. Hence, the functions should not overlap to my understanding.
mypy 0.620 has been used.
Metadata
Metadata
Assignees
Labels
No labels