aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-03 17:59:16 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-03 18:10:45 +0200
commit6c8a2425148753d040ab2dbde6ac57349893b736 (patch)
tree55c1df0e45cab59dd4c373091e09fb51d6d7c398 /src/dotty/tools/dotc/core/Contexts.scala
parent5cb4ecb19cb551609ebee97aa1b199de8468a98a (diff)
downloaddotty-6c8a2425148753d040ab2dbde6ac57349893b736.tar.gz
dotty-6c8a2425148753d040ab2dbde6ac57349893b736.tar.bz2
dotty-6c8a2425148753d040ab2dbde6ac57349893b736.zip
Compute outer.path in lambdaLift at correct phase.
LambdaLift needs to compute outer.path at the phase in which the results are constructed, i.e. phase lambdaLift.next. Or else we get an error in outer.path for lost fo files, including pos/Fileish.scala as a minimized test case. Previously outer as computed at phase lambdaLift. The reason for this is that lambdaLift name mangles inner classes, which causes outer acessors to be not found. We now correct for the problem in outer.path itself, by calling outerAccessor only at a safe phase.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index c1b2e20eb..b00896117 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -231,6 +231,9 @@ object Contexts {
final def withPhase(phase: Phase): Context =
withPhase(phase.id)
+ final def withPhaseNoLater(phase: Phase) =
+ if (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`.
*/