Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ object SymDenotations {
* @return The result may contain false positives, but never false negatives.
*/
final def mayHaveCommonChild(that: ClassSymbol)(using Context): Boolean =
!this.is(Final) && !that.is(Final) && (this.is(Trait) || that.is(Trait)) ||
!this.isOneOf(FinalOrSealed) && !that.isOneOf(FinalOrSealed) && (this.is(Trait) || that.is(Trait)) ||
Copy link
Member

Choose a reason for hiding this comment

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

That's not valid, because the following hierarchy is allowed:

sealed trait A
sealed trait B
class C extends A with B

this.derivesFrom(that) || that.derivesFrom(this.symbol)

final override def typeParamCreationFlags: FlagSet = ClassTypeParamCreationFlags
Expand Down