Skip to content

Commit 6a5505d

Browse files
committed
Combine captured vars and constructors into one macro phase.
Needed to fix a problem in CapturedVars to make this work.
1 parent f625d0b commit 6a5505d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ class Compiler {
6464
new InterceptedMethods,
6565
new Literalize),
6666
List(new Erasure),
67-
List(new CapturedVars),
68-
List(new Constructors)/*,
67+
List(new CapturedVars, new Constructors)/*,
6968
List(new LambdaLift)*/
7069
)
7170

src/dotty/tools/dotc/transform/CapturedVars.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CapturedVars extends MiniPhaseTransform with SymTransformer { thisTransfor
4545
}
4646

4747
override def init(implicit ctx: Context, info: TransformerInfo): Unit =
48-
(new CollectCaptured).runOver(ctx.compilationUnit.tpdTree)
48+
(new CollectCaptured)(ctx.withPhase(thisTransform)).runOver(ctx.compilationUnit.tpdTree)
4949

5050
override def transformSym(sd: SymDenotation)(implicit ctx: Context): SymDenotation =
5151
if (captured(sd.symbol)) {

0 commit comments

Comments
 (0)