Skip to content

0.940: Condition can't be inferred, unable to merge overloads #12335

@twoertwein

Description

@twoertwein

Bug Report
This might be an issue with beartype, it has been reported there beartype/beartype#112. Since mypy reports an overload error at a line that has no overloads, it might be a mypy error (edit: there are overloads around).

To Reproduce

from beartype import beartype

@beartype
def test(x: int) -> int:
    return x

/home/twoertwe/.cache/pypoetry/virtualenvs/python-tools-sgDWaTGJ-py3.10/lib/python3.10/site-packages/beartype/_decor/main.py:294: error: Condition can't be inferred, unable to merge overloads [misc]

The line in question is here:
https://github.com/beartype/beartype/blob/main/beartype/_decor/main.py#L294

Expected Behavior
Either no error or a better indication at which line the error occurs.

Your Environment

  • Mypy version used: 0.940
  • Mypy command-line flags: -
  • Mypy configuration options from mypy.ini (and other config files): -
  • Python version used: 3.10.2
  • Operating system and version: Ubuntu

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