Skip to content

Fix #9977: Refine unrelated types criterion #9980

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 27, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 11, 2020

Need to take account of boxing.

Need to take account of boxing.
val unrelated =
!testCls.derivesFrom(foundCls)
&& !unboxedTestCls.derivesFrom(foundCls)
&& (testCls.is(Final) || !testCls.is(Trait) && !foundCls.is(Trait))
Copy link
Contributor

Choose a reason for hiding this comment

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

This line seems to change semantics of the original code:

Suggested change
&& (testCls.is(Final) || !testCls.is(Trait) && !foundCls.is(Trait))
&& ((testCls.is(Final) || !testCls.is(Trait) && !foundCls.is(Trait)))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. All the suggestion does is double the pair of outer parens

@liufengyun liufengyun assigned odersky and unassigned liufengyun Oct 19, 2020
@odersky odersky merged commit 22c23a5 into scala:master Oct 27, 2020
@odersky odersky deleted the fix-#9977 branch October 27, 2020 08: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