aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-16 09:36:06 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-16 09:36:17 +0100
commite4fd920fdc8e65738111837273a53548bcbb24b9 (patch)
tree78c400112e413c51a394321fb30582e764169832 /compiler/src/dotty/tools/dotc/core/Contexts.scala
parent5d782d316e1c13f92f628bb5a6f1f76d6ea9f8e7 (diff)
downloaddotty-e4fd920fdc8e65738111837273a53548bcbb24b9.tar.gz
dotty-e4fd920fdc8e65738111837273a53548bcbb24b9.tar.bz2
dotty-e4fd920fdc8e65738111837273a53548bcbb24b9.zip
Fix #1806: Define outer accessors at the right phase
Some outer accessors were defined at phase explicitOuter, but were entered into the scope of their enclosing class only at phase explicitOuter + 1. This turned them to stale symbols when trying to access them at a later run, because at their initially valid phase they were not found as members of their owner.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Contexts.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala
index a1b99d16d..29629e505 100644
--- a/compiler/src/dotty/tools/dotc/core/Contexts.scala
+++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala
@@ -262,6 +262,9 @@ object Contexts {
final def withPhaseNoLater(phase: Phase) =
if (phase.exists && ctx.phase.id > phase.id) withPhase(phase) else ctx
+ final def withPhaseNoEarlier(phase: Phase) =
+ 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`.
*/