aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-20 16:35:51 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 12:01:40 +0200
commit1bce89efb9ccb3d58c72a89440d6096de2c6e646 (patch)
tree7ad92492601076f1347bcdf38daa3524707a3ad6 /src/dotty/tools/dotc/core/Contexts.scala
parentf99d3fb1ed3de8390d444d5ee71ce1330a4f92f1 (diff)
downloaddotty-1bce89efb9ccb3d58c72a89440d6096de2c6e646.tar.gz
dotty-1bce89efb9ccb3d58c72a89440d6096de2c6e646.tar.bz2
dotty-1bce89efb9ccb3d58c72a89440d6096de2c6e646.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala2
1 files changed, 1 insertions, 1 deletions
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`.