Skip to content

Commit 5308805

Browse files
committed
Workaround scala#1770: Run changeOwner at group end in ElimByName
Using changeOwnerAfter would be more appropriate but currently fails with an assertion in LambdaLift
1 parent 738acba commit 5308805

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ElimByName.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform
8181
val inSuper = if (ctx.mode.is(Mode.InSuperCall)) InSuperCall else EmptyFlags
8282
val meth = ctx.newSymbol(
8383
ctx.owner, nme.ANON_FUN, Synthetic | Method | inSuper, MethodType(Nil, Nil, argType))
84-
Closure(meth, _ => arg.changeOwner(ctx.owner, meth))
84+
atGroupEnd { implicit ctx: Context =>
85+
Closure(meth, _ => arg.changeOwner(ctx.owner, meth))
86+
}
87+
// Closure(meth, _ => arg.changeOwnerAfter(ctx.owner, methw, thisTransformer))
8588
}
8689
ref(defn.dummyApply).appliedToType(argType).appliedTo(argFun)
8790
case _ =>

0 commit comments

Comments
 (0)