Skip to content

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

Merged
liufengyun merged 2 commits into
scala:masterfrom
dotty-staging:fix-5970
Mar 20, 2019
Merged

liufengyun merged 2 commits into
scala:masterfrom
dotty-staging:fix-5970

Conversation

@liufengyun

Copy link
Copy Markdown
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)

@liufengyun liufengyun Feb 25, 2019 •

Copy link
Copy Markdown
Contributor Author

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.

@OlivierBlanvillain OlivierBlanvillain left a comment

Copy link
Copy Markdown
Contributor

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