Skip to content

Overloaded functions fail when checked with --disallow-untyped-defs #3360

@tyehle

Description

@tyehle

For this minimal example

@overload
def test(val: int) -> int: ...
@overload
def test(val: str) -> str: ...
def test(val):
    return val

with --disallow-untyped-defs mypy fails with error: Function is missing a type annotation
but without it it succeeds.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions