File tree 1 file changed +7
-8
lines changed
compiler/src/dotty/tools/dotc/core/quoted
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
package dotty .tools .dotc .core .quoted
2
2
3
3
import dotty .tools .dotc .ast .Trees ._
4
- import dotty .tools .dotc .ast .tpd
4
+ import dotty .tools .dotc .ast .{ TreeTypeMap , tpd }
5
5
import dotty .tools .dotc .config .Printers ._
6
6
import dotty .tools .dotc .core .Constants .Constant
7
7
import dotty .tools .dotc .core .Contexts ._
@@ -137,13 +137,12 @@ object PickledQuotes {
137
137
def x1Ref () = ref(x1.symbol)
138
138
def rec (f : Tree ): Tree = f match {
139
139
case closureDef(ddef) =>
140
- new TreeMap () {
141
- private val paramSym = ddef.vparamss.head.head.symbol
142
- override def transform (tree : tpd.Tree )(implicit ctx : Context ): tpd.Tree = tree match {
143
- case tree : Ident if tree.symbol == paramSym => x1Ref().withPos(tree.pos)
144
- case _ => super .transform(tree)
145
- }
146
- }.transform(ddef.rhs).changeOwner(ddef.symbol, ctx.owner)
140
+ val paramSym = ddef.vparamss.head.head.symbol
141
+ new TreeTypeMap (
142
+ oldOwners = ddef.symbol :: Nil ,
143
+ newOwners = ctx.owner :: Nil ,
144
+ treeMap = tree => if (tree.symbol == paramSym) x1Ref().withPos(tree.pos) else tree
145
+ ).transform(ddef.rhs)
147
146
case Block (stats, expr) =>
148
147
val applied = rec(expr)
149
148
if (stats.isEmpty) applied
You can’t perform that action at this time.
0 commit comments