diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-26 16:59:51 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-03-27 12:37:59 +0100 |
commit | 29c876a40adaae17d4f47cee906243bda9d8e606 (patch) | |
tree | ee6cf52dab79623b4e4cc7eb8e77f27bb096428d /src/dotty/tools/dotc/core/Types.scala | |
parent | 0e2deaa32e57661743b2cf243833cafee5388b70 (diff) | |
download | dotty-29c876a40adaae17d4f47cee906243bda9d8e606.tar.gz dotty-29c876a40adaae17d4f47cee906243bda9d8e606.tar.bz2 dotty-29c876a40adaae17d4f47cee906243bda9d8e606.zip |
Fix context.withPhase
Previous version was wrong because every context is a fresh context at runtime,
so the overriding version would always be executed, which means that withPhase
becomes a side-effecting operation!
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 7cd66f5dd..501f01a74 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1066,7 +1066,7 @@ object Types { if (d.exists || ctx.phaseId == FirstPhaseId) d else {// name has changed; try load in earlier phase and make current - val d = denot(ctx.fresh.withPhase(ctx.phaseId - 1)).current + val d = denot(ctx.withPhase(ctx.phaseId - 1)).current if (d.exists) d else throw new Error(s"failure to reload $this") } |