Skip to content

Commit aafd56e

Browse files
committed
Move the NoSymbol check to gadtBounds
1 parent 0bdbb4e commit aafd56e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
678678
narrowGADTBounds(tp1, tp2, approx, isUpper = true)) &&
679679
GADTusage(tp1.symbol)
680680
}
681-
isSubType(hi1, tp2, approx.addLow) || ((tp1.symbol ne NoSymbol) && compareGADT)
681+
isSubType(hi1, tp2, approx.addLow) || compareGADT
682682
case _ =>
683683
def isNullable(tp: Type): Boolean = tp.widenDealias match {
684684
case tp: TypeRef => tp.symbol.isNullableClass
@@ -2107,8 +2107,11 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
21072107
}
21082108

21092109
override def gadtBounds(sym: Symbol)(implicit ctx: Context): TypeBounds = {
2110-
footprint += sym.typeRef
2111-
super.gadtBounds(sym)
2110+
if (sym eq NoSymbol) null
2111+
else {
2112+
footprint += sym.typeRef
2113+
super.gadtBounds(sym)
2114+
}
21122115
}
21132116

21142117
override def gadtAddLowerBound(sym: Symbol, b: Type): Boolean = {

0 commit comments

Comments
 (0)