File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,10 @@ object Contexts {
77
77
78
78
/** The current context */
79
79
private [this ] var _period : Period = _
80
- protected def period_= (period : Period ) = _period = period
80
+ protected def period_= (period : Period ) = {
81
+ assert(period.firstPhaseId == period.lastPhaseId, period)
82
+ _period = period
83
+ }
81
84
def period : Period = _period
82
85
83
86
/** The scope nesting level */
@@ -193,7 +196,7 @@ object Contexts {
193
196
/** This context at given phase.
194
197
* This method will always return a phase period equal to phaseId, thus will never return squashed phases
195
198
*/
196
- final def withPhase (phaseId : PhaseId ): Context = {
199
+ final def withPhase (phaseId : PhaseId ): Context =
197
200
if (this .phaseId == phaseId) this
198
201
else if (phasedCtx.phaseId == phaseId) phasedCtx
199
202
else if (phasedCtxs != null && phasedCtxs(phaseId) != null ) phasedCtxs(phaseId)
@@ -206,7 +209,6 @@ object Contexts {
206
209
}
207
210
ctx1
208
211
}
209
- }
210
212
211
213
final def withPhase (phase : Phase ): Context =
212
214
withPhase(phase.id)
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ object Phases {
194
194
195
195
def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): List [CompilationUnit ] =
196
196
units.map { unit =>
197
- val unitCtx = ctx.fresh.setPhase(this ).setCompilationUnit(unit)
197
+ val unitCtx = ctx.fresh.setPhase(this .start ).setCompilationUnit(unit)
198
198
run(unitCtx)
199
199
unitCtx.compilationUnit
200
200
}
You can’t perform that action at this time.
0 commit comments