Skip to content

Improve diagnostics for failed call to overloaded function #274

@carljm

Description

@carljm

Currently we emit a very opaque "No overload of bound method __init__ matches" diagnostic, with zero additional context: no reference to the called function, its overloads, what failed to match, etc.

Sample code:

from typing import overload

@overload
def f(x: int) -> int: ...

@overload
def f(x: str) -> str: ...

def f(x: int | str) -> int | str:
    return x

f(b"foo")

Metadata

Metadata

Assignees

Labels

callsIssues relating to call-signature checking and diagnosticsdiagnosticsRelated to reporting of diagnostics.overloads

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions