Skip to content

Commit

Permalink
Allow some kindness in provablyDisjoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Dec 12, 2023
1 parent 6fd207f commit 98c10c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2841,8 +2841,9 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
case (tp1: TypeRef, tp2: TypeRef) if tp1.symbol.isClass && tp2.symbol.isClass =>
val cls1 = tp1.classSymbol
val cls2 = tp2.classSymbol
val sameKind = tp1.hasSameKindAs(tp2)
def isDecomposable(sym: Symbol, tp: Type): Boolean =
tp.hasSimpleKind && sym.is(Sealed) && !sym.hasAnonymousChild
sameKind && sym.is(Sealed) && !sym.hasAnonymousChild
def decompose(sym: Symbol, tp: Type): List[Type] =
sym.children.map(x => refineUsingParent(tp, x)).filter(_.exists)
if (cls1.derivesFrom(cls2) || cls2.derivesFrom(cls1))
Expand Down

0 comments on commit 98c10c9

Please sign in to comment.