Skip to content

Commit 0ece69a

Browse files
committed
Use atPhase instead of inContext where possible
1 parent f3e03fc commit 0ece69a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I) extends BTypes {
229229
// After lambdalift (which is where we are), the rawowoner field contains the enclosing class.
230230
val enclosingClassSym = {
231231
if (innerClassSym.isClass) {
232-
inContext(ctx.withPhase(ctx.flattenPhase.prev)) {
232+
atPhase(ctx.flattenPhase.prev) {
233233
toDenot(innerClassSym).owner.enclosingClass
234234
}
235235
}

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ object DottyBackendInterface {
137137
// for example by specialization
138138
val original = toDenot(sym).initial
139139
val validity = original.validFor
140-
inContext(ctx.withPhase(validity.phaseId)) {
140+
atPhase(validity.phaseId) {
141141
toDenot(sym).isStatic
142142
}
143143
}
@@ -149,7 +149,7 @@ object DottyBackendInterface {
149149
// it is very tricky in presence of classes(and annonymous classes) defined inside supper calls.
150150
if (sym.exists) {
151151
val validity = toDenot(sym).initial.validFor
152-
inContext(ctx.withPhase(validity.phaseId)) {
152+
atPhase(validity.phaseId) {
153153
toDenot(sym).lexicallyEnclosingClass
154154
}
155155
} else NoSymbol

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ object SymDenotations {
22012201
def ensureFreshScopeAfter(phase: DenotTransformer)(using Context): Unit =
22022202
if (ctx.phaseId != phase.next.id) ensureFreshScopeAfter(phase)(using ctx.withPhase(phase.next))
22032203
else {
2204-
val prevClassInfo = inContext(ctx.withPhase(phase)) {
2204+
val prevClassInfo = atPhase(phase) {
22052205
current.asInstanceOf[ClassDenotation].classInfo
22062206
}
22072207
val ClassInfo(pre, _, ps, decls, selfInfo) = classInfo

0 commit comments

Comments
 (0)