Skip to content

Fix multiversal equality checks for pattern matching #9991

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 1 commit into from
Oct 13, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 13, 2020

Equality checks against constants in patterns were usually suppressed since they were only issued if
the GADT constrainer returned false. We now drop this as a condition.

This uncovered a missing position error, where we did a resolveOverloading when unpickling some
Scala 2 code in Pattern mode. The missing position was the tree in the equality check, which
is not surprising since was an annotation argument. The fix here was to make sure that we do
overloading resolution only in expression mode.

Equality checks against constants in patterns were usually suppressed since they were only issued if
the GADT constrainer return false. We now drop this as a condition.

This uncovered a missing position error, where we did a resolveOverloading when unpickling some
Scala 2 code in Pattern mode. The missing position was the tree in the equality check, which
is not surprising since was an annotation argument. The fix here was to make sure that we do
overloading resolution only in expression mode.
Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

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

LGTM!

@abgruszecki abgruszecki merged commit 84e28e8 into scala:master Oct 13, 2020
@abgruszecki abgruszecki deleted the fix-eql branch October 13, 2020 11:34
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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