Skip to content

Commit 88d11fa

Browse files
oderskyDarkDimius
authored andcommitted
Combine captured vars and constructors into one macro phase.
Needed to fix a problem in CapturedVars to make this work.
1 parent 96f754c commit 88d11fa

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
@@ -63,8 +63,7 @@ class Compiler {
6363
new InterceptedMethods,
6464
new Literalize),
6565
List(new Erasure),
66-
List(new CapturedVars),
67-
List(new Constructors)/*,
66+
List(new CapturedVars, new Constructors)/*,
6867
List(new LambdaLift)*/
6968
)
7069

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)