@@ -102,7 +102,7 @@ object Inliner {
102
102
103
103
val bindings = new mutable.ListBuffer [Tree ]
104
104
105
- /** Lift bindings in function or argument of inline call to
105
+ /** Lift bindings around inline call or in its function part to
106
106
* the `bindings` buffer. This is done as an optimization to keep
107
107
* inline call expansions smaller.
108
108
*/
@@ -115,15 +115,15 @@ object Inliner {
115
115
val lifter = liftFromInlined(call)
116
116
cpy.Inlined (tree)(call, Nil , liftBindings(expr, liftFromInlined(call).transform(_)))
117
117
case Apply (fn, args) =>
118
- cpy.Apply (tree)(liftBindings(fn, liftPos), args.map(liftBindings(_, liftPos)) )
118
+ cpy.Apply (tree)(liftBindings(fn, liftPos), args)
119
119
case TypeApply (fn, args) =>
120
120
cpy.TypeApply (tree)(liftBindings(fn, liftPos), args)
121
121
case Select (qual, name) =>
122
122
cpy.Select (tree)(liftBindings(qual, liftPos), name)
123
123
case _ =>
124
124
tree
125
125
}
126
-
126
+
127
127
val tree1 = liftBindings(tree, identity)
128
128
if (bindings.nonEmpty)
129
129
cpy.Block (tree)(bindings.toList, inlineCall(tree1, pt))
@@ -511,7 +511,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
511
511
else letBindUnless(TreeInfo .Pure , arg)(seq(trailing, _))
512
512
val fullArg = seq(prefix, seq(leading, argInPlace))
513
513
new TreeTypeMap ().transform(fullArg) // make sure local bindings in argument have fresh symbols
514
- .reporting(res => i " projecting $tree -> $res" )
514
+ .reporting(res => i " projecting $tree -> $res" , inlining )
515
515
}
516
516
else tree
517
517
case Block (stats, expr) if stats.forall(isPureBinding) =>
0 commit comments