@@ -39,9 +39,6 @@ abstract class Lifter {
39
39
/** The tree of a lifted definition */
40
40
protected def liftedDef (sym : TermSymbol , rhs : Tree )(using Context ): MemberDef = ValDef (sym, rhs)
41
41
42
- /** Is lifting performed on erased terms? */
43
- protected def isErased = false
44
-
45
42
private def lift (defs : mutable.ListBuffer [Tree ], expr : Tree , prefix : TermName = EmptyTermName )(using Context ): Tree =
46
43
if (noLift(expr)) expr
47
44
else {
@@ -117,8 +114,7 @@ abstract class Lifter {
117
114
case Apply (fn, args) =>
118
115
val fn1 = liftApp(defs, fn)
119
116
val args1 = liftArgs(defs, fn.tpe, args)
120
- if isErased then untpd.cpy.Apply (tree)(fn1, args1).withType(tree.tpe) // application may be partial
121
- else cpy.Apply (tree)(fn1, args1)
117
+ cpy.Apply (tree)(fn1, args1)
122
118
case TypeApply (fn, targs) =>
123
119
cpy.TypeApply (tree)(liftApp(defs, fn), targs)
124
120
case Select (pre, name) if isPureRef(tree) =>
@@ -141,7 +137,7 @@ abstract class Lifter {
141
137
*
142
138
* unless `pre` is idempotent.
143
139
*/
144
- def liftNonIdempotentPrefix (defs : mutable.ListBuffer [Tree ], tree : Tree )(using Context ): Tree =
140
+ private def liftNonIdempotentPrefix (defs : mutable.ListBuffer [Tree ], tree : Tree )(using Context ): Tree =
145
141
if (isIdempotentExpr(tree)) tree else lift(defs, tree)
146
142
147
143
/** Lift prefix `pre` of an application `pre.f(...)` to
@@ -154,7 +150,7 @@ abstract class Lifter {
154
150
* Note that default arguments will refer to the prefix, we do not want
155
151
* to re-evaluate a complex expression each time we access a getter.
156
152
*/
157
- def liftPrefix (defs : mutable.ListBuffer [Tree ], tree : Tree )(using Context ): Tree =
153
+ private def liftPrefix (defs : mutable.ListBuffer [Tree ], tree : Tree )(using Context ): Tree =
158
154
tree match
159
155
case tree : Literal => tree
160
156
case tree : This => tree
@@ -218,9 +214,6 @@ object LiftCoverage extends LiftImpure {
218
214
}
219
215
}
220
216
221
- object LiftErased extends LiftComplex :
222
- override def isErased = true
223
-
224
217
/** Lift all impure or complex arguments to `def`s */
225
218
object LiftToDefs extends LiftComplex {
226
219
override def liftedFlags : FlagSet = Method
0 commit comments