Skip to content

Commit 705f304

Browse files
authored
Merge pull request #7391 from dotty-staging/fix-#7387
Fix #7387: Avoid comparing NoType with other types
2 parents 082edca + 9b52fb7 commit 705f304

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
@@ -550,6 +550,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
550550
case tp1: RecType =>
551551
val rthis1 = tp1.recThis
552552
recur(tp1.parent, tp2.parent.substRecThis(tp2, rthis1))
553+
case NoType => false
553554
case _ =>
554555
val tp1stable = ensureStableSingleton(tp1)
555556
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)