@@ -14,6 +14,7 @@ import NameKinds.UniqueName
14
14
import util .Spans ._
15
15
import collection .mutable
16
16
import Trees ._
17
+ import Decorators ._
17
18
18
19
/** A class that handles argument lifting. Argument lifting is needed in the following
19
20
* scenarios:
@@ -47,7 +48,10 @@ abstract class Lifter {
47
48
var liftedType = expr.tpe.widen
48
49
if (liftedFlags.is(Method )) liftedType = ExprType (liftedType)
49
50
val lifted = ctx.newSymbol(ctx.owner, name, liftedFlags | Synthetic , liftedType, coord = spanCoord(expr.span))
50
- defs += liftedDef(lifted, expr).withSpan(expr.span).setDefTree
51
+ defs += liftedDef(lifted, expr)
52
+ .withSpan(expr.span)
53
+ .changeNonLocalOwners(lifted)
54
+ .setDefTree
51
55
ref(lifted.termRef).withSpan(expr.span.focus)
52
56
}
53
57
@@ -179,7 +183,7 @@ object EtaExpansion extends LiftImpure {
179
183
* If `expr` has implicit function type, the arguments are passed with `given`.
180
184
* E.g. for (1):
181
185
*
182
- * { val xs = es; (x1, ..., xn) => expr given ( x1, ..., xn) }
186
+ * { val xs = es; (x1, ..., xn) => expr( given x1, ..., xn) }
183
187
*
184
188
* Case (3) applies if the method is curried, i.e. its result type is again a method
185
189
* type. Case (2) applies if the expected arity of the function type `xarity` differs
0 commit comments