Skip to content

Commit 98c10c9

Browse files
committed
Allow some kindness in provablyDisjoint
1 parent 6fd207f commit 98c10c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2841,8 +2841,9 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
28412841
case (tp1: TypeRef, tp2: TypeRef) if tp1.symbol.isClass && tp2.symbol.isClass =>
28422842
val cls1 = tp1.classSymbol
28432843
val cls2 = tp2.classSymbol
2844+
val sameKind = tp1.hasSameKindAs(tp2)
28442845
def isDecomposable(sym: Symbol, tp: Type): Boolean =
2845-
tp.hasSimpleKind && sym.is(Sealed) && !sym.hasAnonymousChild
2846+
sameKind && sym.is(Sealed) && !sym.hasAnonymousChild
28462847
def decompose(sym: Symbol, tp: Type): List[Type] =
28472848
sym.children.map(x => refineUsingParent(tp, x)).filter(_.exists)
28482849
if (cls1.derivesFrom(cls2) || cls2.derivesFrom(cls1))

0 commit comments

Comments
 (0)