Skip to content

Report note about binary operation on the same line as error #8936

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jun 3, 2020

This way we also suppress the note when ignoring the error.

This way we also suppress the note when ignoring the error.
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -2683,7 +2683,7 @@ def check_op(self, method: str, base_type: Type,
if len(left_variants) >= 2 and len(right_variants) >= 2:
self.msg.warn_both_operands_are_from_unions(context)
elif len(left_variants) >= 2:
self.msg.warn_operand_was_from_union("Left", base_type, context=right_expr)
self.msg.warn_operand_was_from_union("Left", base_type, context=context)
elif len(right_variants) >= 2:
self.msg.warn_operand_was_from_union("Right", right_type, context=right_expr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make the same change here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR to do this more consistently.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jun 3, 2020

@ilevkivskyi I updated the logic for finding the note location since a bunch of tests were failing.

@JukkaL JukkaL merged commit c796a56 into master Jun 3, 2020
@gvanrossum gvanrossum deleted the operator-note-line branch August 26, 2020 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants