Skip to content

Overloaded function signatures overlap with incompatible return types, class and Callable #1941

Closed
@tharvik

Description

@tharvik
from typing import Any, Callable, overload

F = Callable[..., Any]

class A: ...

@overload
def f(exit: A) -> A: ...
@overload
def f(exit: F) -> F: ...

gives

asd.py:8: error: Overloaded function signatures 1 and 2 overlap with incompatible return types

which I don't understand. There is no overlap (expect that A is also a Callable), so, why the message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions