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/Periods.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/Periods.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Periods.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala index 61f395c7d..6e1522e26 100644 --- a/src/dotty/tools/dotc/core/Periods.scala +++ b/src/dotty/tools/dotc/core/Periods.scala @@ -23,7 +23,7 @@ abstract class Periods extends DotClass { self: Context => /** Execute `op` at given phase id */ def atPhase[T](pid: PhaseId)(op: Context => T): T = - op(ctx.fresh.withPhase(pid)) + op(ctx.withPhase(pid)) /** The period containing the current period where denotations do not change. * We compute this by taking as first phase the first phase less or equal to |