KEMBAR78
TYPE_CHECKING overload with implementation just outside flags second usage, but not first · Issue #19015 · python/mypy · GitHub
Skip to content

TYPE_CHECKING overload with implementation just outside flags second usage, but not first #19015

@graingert

Description

@graingert

Bug Report

TYPE_CHECKING overload with implementation just outside flags second usage, but not first

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.12&gist=9aa50566df450052503989e5bba6a3c7

Expected Behavior
No errors (or errors on all use of overload)

Actual Behavior

main.py:14: error: An overloaded function outside a stub file must have an implementation  [no-overload-impl]
main.py:20: error: Name "spam" already defined on line 14  [no-redef]
Found 2 errors in 1 file (checked 1 source file)

Your Environment

see playground url

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions