From 1bce89efb9ccb3d58c72a89440d6096de2c6e646 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 20 May 2016 16:35:51 +0200 Subject: 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. --- src/dotty/tools/dotc/core/Contexts.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index bbe8e920c..e1aeac8c3 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -248,7 +248,7 @@ object Contexts { withPhase(phase.id) final def withPhaseNoLater(phase: Phase) = - if (ctx.phase.id > phase.id) withPhase(phase) else ctx + if (phase.exists && ctx.phase.id > phase.id) withPhase(phase) else ctx /** If -Ydebug is on, the top of the stack trace where this context * was created, otherwise `null`. -- cgit v1.2.3