From 23809fb07940da0e4fe944c4b15833a47cf46f7a Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Tue, 1 May 2018 15:49:28 +0200 Subject: [PATCH] Fix tree traversal in ElimByName ElimByName prevented some trees to be traversed by the following phases in the group. --- compiler/src/dotty/tools/dotc/transform/ElimByName.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala index f0c22425e0e7..ba1c572f45c6 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala @@ -49,8 +49,10 @@ class ElimByName extends TransformByNameApply with InfoTransformer { /** Map `tree` to `tree.apply()` is `ftree` was of ExprType and becomes now a function */ private def applyIfFunction(tree: Tree, ftree: Tree)(implicit ctx: Context) = - if (isByNameRef(ftree)) - ctx.atPhase(next) { implicit ctx => tree.select(defn.Function0_apply).appliedToNone } + if (isByNameRef(ftree)) { + val tree0 = transformFollowing(tree) + ctx.atPhase(next) { implicit ctx => tree0.select(defn.Function0_apply).appliedToNone } + } else tree override def transformIdent(tree: Ident)(implicit ctx: Context): Tree =