Skip to content

Commit 877ad05

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

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
10581058
}
10591059

10601060
// begin recur
1061-
if (tp2 eq NoType) false
1061+
if (tp1.eq(NoType) || tp2.eq(NoType)) false
10621062
else if (tp1 eq tp2) true
10631063
else {
10641064
val saved = constraint

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)