Skip to content

Commit 8547e0d

Browse files
committed
Use withMode instead of inMode
1 parent 5c1f86a commit 8547e0d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object Contexts {
9595
inline def atPhaseNoEarlier[T](limit: Phase)(inline op: Context ?=> T)(using Context): T =
9696
op(using if !limit.exists || limit <= ctx.phase then ctx else ctx.withPhase(limit))
9797

98-
inline def inMode[T](mode: Mode)(inline op: Context ?=> T)(using ctx: Context): T =
98+
inline private def inMode[T](mode: Mode)(inline op: Context ?=> T)(using ctx: Context): T =
9999
op(using if mode != ctx.mode then ctx.fresh.setMode(mode) else ctx)
100100

101101
inline def withMode[T](mode: Mode)(inline op: Context ?=> T)(using ctx: Context): T =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5037,7 +5037,7 @@ object Types extends TypeUtils {
50375037
record("MatchType.reduce computed")
50385038
if (myReduced != null) record("MatchType.reduce cache miss")
50395039
myReduced =
5040-
trace(i"reduce match type $this $hashCode", matchTypes, show = true)(inMode(Mode.Type) {
5040+
trace(i"reduce match type $this $hashCode", matchTypes, show = true)(withMode(Mode.Type) {
50415041
def matchCases(cmp: TrackingTypeComparer): Type =
50425042
val saved = ctx.typerState.snapshot()
50435043
try cmp.matchCases(scrutinee.normalized, cases.map(MatchTypeCaseSpec.analyze(_)))

0 commit comments

Comments
 (0)