Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

(馃悶) Note reported on wrong line #13245

Open
KotlinIsland opened this issue Jul 27, 2022 · 0 comments
Open

(馃悶) Note reported on wrong line #13245

KotlinIsland opened this issue Jul 27, 2022 · 0 comments
Labels
bug mypy got something wrong

Comments

@KotlinIsland
Copy link
Contributor

c: str
a: range | object
a + (
    "".join(
        "" + 1
    )
)
test.py:3:1: error: Unsupported left operand type for + ("range")  [operator]
    a + (
    ^
test.py:3:1: error: Unsupported left operand type for + ("object")  [operator]
    a + (
    ^
test.py:5:14: error: Unsupported operand types for + ("str" and "int")  [operator]
            "" + 1
                 ^
test.py:5:14: note: Left operand is of type "range | object"

In this instance, this note is completely irrelevant and very confusing.
Left operand is of type "range | object"?

This is coming from checkexpr.check_op/MessageBuilder.warn_operand_was_from_union

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant