Skip to content

Commit 9b52fb7

Browse files
committed
Fix #7387: Avoid comparing NoType with other types
1 parent 441c2ee commit 9b52fb7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
549549
case tp1: RecType =>
550550
val rthis1 = tp1.recThis
551551
recur(tp1.parent, tp2.parent.substRecThis(tp2, rthis1))
552+
case NoType => false
552553
case _ =>
553554
val tp1stable = ensureStableSingleton(tp1)
554555
recur(fixRecs(tp1stable, tp1stable.widenExpr), tp2.parent.substRecThis(tp2, tp1stable))

tests/neg/i7387.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
type E = A.B { type C = D } // error: Not found: A
2+
def g = summon[E] // error: no implicit argument of type E

0 commit comments

Comments
 (0)