Skip to content

Commit b9b4767

Browse files
committed
add a field for subtype checker to avoid creating closures repeatedly
1 parent c1753fe commit b9b4767

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ object RefChecks {
242242
// compatibility checking.
243243
def checkSubType(tp1: Type, tp2: Type)(using Context): Boolean = tp1 frozen_<:< tp2
244244

245+
private val subtypeChecker: (Type, Type) => Context ?=> Boolean = this.checkSubType
246+
245247
def checkAll(checkOverride: ((Type, Type) => Context ?=> Boolean, Symbol, Symbol) => Unit) =
246248
while hasNext do
247-
checkOverride(checkSubType, overriding, overridden)
249+
checkOverride(subtypeChecker, overriding, overridden)
248250
next()
249251

250252
// The OverridingPairs cursor does assume that concrete overrides abstract

0 commit comments

Comments
 (0)