Skip to content

Commit 817315e

Browse files
committed
Fix tree traversal in ElimByName
ElimByName prevented some trees to be traversed by the following phases in the group.
1 parent e87a5d1 commit 817315e

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
@@ -50,7 +50,11 @@ class ElimByName extends TransformByNameApply with InfoTransformer {
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) =
5252
if (isByNameRef(ftree))
53-
ctx.atPhase(next) { implicit ctx => tree.select(defn.Function0_apply).appliedToNone }
53+
ctx.atPhase(next) { implicit ctx =>
54+
transformFollowing(tree)
55+
.select(defn.Function0_apply)
56+
.appliedToNone
57+
}
5458
else tree
5559

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

0 commit comments

Comments
 (0)