Skip to content

Fix #5970: suppress spurious warning in isInstanceOf check #5985

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 2 commits into from
Mar 20, 2019

Conversation

liufengyun
Copy link
Contributor

Fix #5970: suppress spurious warning in isInstanceOf check

final def mayHaveCommonChild(that: ClassSymbol)(implicit ctx: Context): Boolean =
!this.is(Final) && !that.is(Final) && (this.is(Trait) || that.is(Trait)) ||
this.derivesFrom(that) || that.derivesFrom(this.symbol)

Copy link
Contributor Author

@liufengyun liufengyun Feb 25, 2019

Choose a reason for hiding this comment

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

@OlivierBlanvillain I'm not sure how this fits into your refactoring. Maybe we can delay this PR until the refactoring is merged.

Copy link
Contributor

@OlivierBlanvillain OlivierBlanvillain left a comment

Choose a reason for hiding this comment

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

I have plans to also factor out the logic in TypeTestsCasts.scala but I didn't do anything so far, so this is LGTM!

@liufengyun liufengyun merged commit f926147 into scala:master Mar 20, 2019
@liufengyun liufengyun deleted the fix-5970 branch March 20, 2019 15:27
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.

2 participants