Skip to content

Commit cb2c2a0

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 8d603d8 commit cb2c2a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ 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+
Closure(meth, _ =>
85+
atGroupEnd { implicit ctx: Context =>
86+
arg.changeOwner(ctx.owner, meth)
87+
}
88+
)
8589
}
8690
ref(defn.dummyApply).appliedToType(argType).appliedTo(argFun)
8791
case _ =>

0 commit comments

Comments
 (0)