Skip to content

Commit a56c5ae

Browse files
committed
Fix tree traversal in ElimByName
ElimByName prevented some trees to be traversed by the following phases in the group.
1 parent 9df8b0b commit a56c5ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ class ElimByName extends TransformByNameApply with InfoTransformer {
4949

5050
/** Map `tree` to `tree.apply()` is `ftree` was of ExprType and becomes now a function */
5151
private def applyIfFunction(tree: Tree, ftree: Tree)(implicit ctx: Context) =
52-
if (isByNameRef(ftree))
53-
ctx.atPhase(next) { implicit ctx => tree.select(defn.Function0_apply).appliedToNone }
52+
if (isByNameRef(ftree)) {
53+
val tree0 = transformFollowing(tree)
54+
ctx.atPhase(next) { implicit ctx => tree0.select(defn.Function0_apply).appliedToNone }
55+
}
5456
else tree
5557

5658
override def transformIdent(tree: Ident)(implicit ctx: Context): Tree =

0 commit comments

Comments
 (0)