Skip to content

Commit 9d8c161

Browse files
Clarify what I ment by new cls1
1 parent 0cc29a0 commit 9d8c161

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -2564,9 +2564,10 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
25642564
// of classes.
25652565
true
25662566
else if (isDecomposable(cls1))
2567-
// At this point, !cls1.derivesFrom(cls2): we know that `cls1`
2568-
// is disjoint from `tp2`. Therefore, we can safely decompose
2569-
// `cls1` using `.children`, even if `cls1` is non abstract.
2567+
// At this point, !cls1.derivesFrom(cls2): we know that direct
2568+
// instantiations of `cls1` (terms of the form `new cls1`) are not
2569+
// of type `tp2`. Therefore, we can safely decompose `cls1` using
2570+
// `.children`, even if `cls1` is non abstract.
25702571
decompose(cls1, tp1).forall(x => provablyDisjoint(x, tp2))
25712572
else if (isDecomposable(cls2))
25722573
decompose(cls2, tp2).forall(x => provablyDisjoint(x, tp1))

0 commit comments

Comments
 (0)