Skip to content

Commit 8c22245

Browse files
committed
Simplify RecType.closeOver
1 parent 763e0c0 commit 8c22245

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,12 +2204,7 @@ object Types {
22042204
}
22052205
def closeOver(parentExp: RecType => Type)(implicit ctx: Context) = {
22062206
val rt = this(parentExp)
2207-
//val self = RecThis(rt)
2208-
def isSelfRef(t: Type) = t match {
2209-
case RecThis(binder) => binder eq rt
2210-
case _ => false
2211-
}
2212-
if (rt.existsPart(isSelfRef)) rt else rt.parent
2207+
if (rt.isReferredToBy(rt.parent)) rt else rt.parent
22132208
}
22142209
}
22152210

0 commit comments

Comments
 (0)