Skip to content

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