aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-21 16:10:04 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-11 08:24:36 +0200
commit88d11fa21761d798baeb24b8002ddacade601b23 (patch)
tree80b3b55de284298ab245f21f97245f1dc91b0fec
parent96f754c92713d1a199b844fe5501dafaad45d7cb (diff)
downloaddotty-88d11fa21761d798baeb24b8002ddacade601b23.tar.gz
dotty-88d11fa21761d798baeb24b8002ddacade601b23.tar.bz2
dotty-88d11fa21761d798baeb24b8002ddacade601b23.zip
Combine captured vars and constructors into one macro phase.
Needed to fix a problem in CapturedVars to make this work.
-rw-r--r--src/dotty/tools/dotc/Compiler.scala3
-rw-r--r--src/dotty/tools/dotc/transform/CapturedVars.scala2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index 87cac9799..63f79c8d3 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -63,8 +63,7 @@ class Compiler {
new InterceptedMethods,
new Literalize),
List(new Erasure),
- List(new CapturedVars),
- List(new Constructors)/*,
+ List(new CapturedVars, new Constructors)/*,
List(new LambdaLift)*/
)
diff --git a/src/dotty/tools/dotc/transform/CapturedVars.scala b/src/dotty/tools/dotc/transform/CapturedVars.scala
index 59a766819..91b81fea5 100644
--- a/src/dotty/tools/dotc/transform/CapturedVars.scala
+++ b/src/dotty/tools/dotc/transform/CapturedVars.scala
@@ -45,7 +45,7 @@ class CapturedVars extends MiniPhaseTransform with SymTransformer { thisTransfor
}
override def init(implicit ctx: Context, info: TransformerInfo): Unit =
- (new CollectCaptured).runOver(ctx.compilationUnit.tpdTree)
+ (new CollectCaptured)(ctx.withPhase(thisTransform)).runOver(ctx.compilationUnit.tpdTree)
override def transformSym(sd: SymDenotation)(implicit ctx: Context): SymDenotation =
if (captured(sd.symbol)) {