Skip to content

Commit 9e25a62

Browse files
committed
Fix of accidental omission in TypeComparer
1 parent c3ba4fe commit 9e25a62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,9 @@ class TypeComparer(initctx: Context) extends DotClass {
715715

716716
/** Two types are the same if are mutual subtypes of each other */
717717
def isSameType(tp1: Type, tp2: Type): Boolean =
718-
isSubType(tp1, tp2) && isSubType(tp2, tp1)
718+
if (tp1 eq NoType) false
719+
else if (tp1 eq tp2) true
720+
else isSubType(tp1, tp2) && isSubType(tp2, tp1)
719721

720722
/** Same as `isSameType` but also can be applied to overloaded TermRefs, where
721723
* two overloaded refs are the same if they have pairwise equal alternatives

0 commit comments

Comments
 (0)