aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Phases.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-26 16:59:51 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-27 12:37:59 +0100
commit29c876a40adaae17d4f47cee906243bda9d8e606 (patch)
treeee6cf52dab79623b4e4cc7eb8e77f27bb096428d /src/dotty/tools/dotc/core/Phases.scala
parent0e2deaa32e57661743b2cf243833cafee5388b70 (diff)
downloaddotty-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/Phases.scala')
-rw-r--r--src/dotty/tools/dotc/core/Phases.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala
index 7ae7b6ad3..ee993b890 100644
--- a/src/dotty/tools/dotc/core/Phases.scala
+++ b/src/dotty/tools/dotc/core/Phases.scala
@@ -163,7 +163,7 @@ object Phases {
def run(implicit ctx: Context): Unit
def runOn(units: List[CompilationUnit])(implicit ctx: Context): Unit =
- for (unit <- units) run(ctx.fresh.withPhase(this).withCompilationUnit(unit))
+ for (unit <- units) run(ctx.fresh.withNewPhase(this).withCompilationUnit(unit))
def description: String = name