Skip to content

Commit 6400ffa

Browse files
committed
Drop more ctx bindings
1 parent adeeedd commit 6400ffa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ trait SymDenotations { thisCtx: Context =>
8585
case denot: SymDenotation =>
8686
def explainSym(msg: String) = explain(s"$msg\ndefined = ${denot.definedPeriodsString}")
8787
if (denot.isOneOf(ValidForeverFlags) || denot.isRefinementClass) true
88-
else {
89-
implicit val ctx = thisCtx
88+
else inContext(thisCtx) {
9089
val initial = denot.initial
9190
if ((initial ne denot) || ctx.phaseId != initial.validFor.firstPhaseId)
9291
ctx.withPhase(initial.validFor.firstPhaseId).traceInvalid(initial)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
235235
def firstTry: Boolean = tp2 match {
236236
case tp2: NamedType =>
237237
def compareNamed(tp1: Type, tp2: NamedType): Boolean =
238-
implicit val ctx: Context = this.ctx
238+
val ctx = this.ctx
239+
given Context = ctx // optimization for performance
239240
val info2 = tp2.info
240241
info2 match
241242
case info2: TypeAlias =>

0 commit comments

Comments
 (0)