From e4fd920fdc8e65738111837273a53548bcbb24b9 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 16 Dec 2016 09:36:06 +0100 Subject: 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. --- compiler/src/dotty/tools/dotc/core/Contexts.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/src/dotty/tools/dotc/core/Contexts.scala') 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`. */ -- cgit v1.2.3