Skip to content

Commit f1bad54

Browse files
Use withMode instead of inMode (#19574)
2 parents a5b6907 + 8547e0d commit f1bad54

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
@@ -5043,7 +5043,7 @@ object Types extends TypeUtils {
50435043
record("MatchType.reduce computed")
50445044
if (myReduced != null) record("MatchType.reduce cache miss")
50455045
myReduced =
5046-
trace(i"reduce match type $this $hashCode", matchTypes, show = true)(inMode(Mode.Type) {
5046+
trace(i"reduce match type $this $hashCode", matchTypes, show = true)(withMode(Mode.Type) {
50475047
def matchCases(cmp: TrackingTypeComparer): Type =
50485048
val saved = ctx.typerState.snapshot()
50495049
try cmp.matchCases(scrutinee.normalized, cases.map(MatchTypeCaseSpec.analyze(_)))

0 commit comments

Comments
 (0)