Skip to content

Commit 4755570

Browse files
committed
Fix withPhaseNoLater
It's possible that the given phase argument does not exist, in which case we do not want to set the current phase to NoPhase.
1 parent daf736c commit 4755570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ object Contexts {
248248
withPhase(phase.id)
249249

250250
final def withPhaseNoLater(phase: Phase) =
251-
if (ctx.phase.id > phase.id) withPhase(phase) else ctx
251+
if (phase.exists && ctx.phase.id > phase.id) withPhase(phase) else ctx
252252

253253
/** If -Ydebug is on, the top of the stack trace where this context
254254
* was created, otherwise `null`.

0 commit comments

Comments
 (0)