Skip to content

Commit 0b57c1d

Browse files
committed
Only conditionalise adding to footprint
1 parent 83cfad9 commit 0b57c1d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

+4-7
Original file line numberDiff line numberDiff line change
@@ -2107,20 +2107,17 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
21072107
}
21082108

21092109
override def gadtBounds(sym: Symbol)(implicit ctx: Context): TypeBounds = {
2110-
if (!sym.exists) null
2111-
else {
2112-
footprint += sym.typeRef
2113-
super.gadtBounds(sym)
2114-
}
2110+
if (sym.exists) footprint += sym.typeRef
2111+
super.gadtBounds(sym)
21152112
}
21162113

21172114
override def gadtAddLowerBound(sym: Symbol, b: Type): Boolean = {
2118-
footprint += sym.typeRef
2115+
if (sym.exists) footprint += sym.typeRef
21192116
super.gadtAddLowerBound(sym, b)
21202117
}
21212118

21222119
override def gadtAddUpperBound(sym: Symbol, b: Type): Boolean = {
2123-
footprint += sym.typeRef
2120+
if (sym.exists) footprint += sym.typeRef
21242121
super.gadtAddUpperBound(sym, b)
21252122
}
21262123

0 commit comments

Comments
 (0)