@@ -21,9 +21,6 @@ import Decorators.*
21
21
* @param newOwners New owners, replacing previous owners.
22
22
* @param substFrom The symbols that need to be substituted.
23
23
* @param substTo The substitution targets.
24
- * @param cpy A tree copier that is used to create new trees.
25
- * @param alwaysCopySymbols If set, symbols are always copied, even when they
26
- * are not impacted by the transformation.
27
24
*
28
25
* The reason the substitution is broken out from the rest of the type map is
29
26
* that all symbols have to be substituted at the same time. If we do not do this,
@@ -41,9 +38,7 @@ class TreeTypeMap(
41
38
val newOwners : List [Symbol ] = Nil ,
42
39
val substFrom : List [Symbol ] = Nil ,
43
40
val substTo : List [Symbol ] = Nil ,
44
- cpy : tpd.TreeCopier = tpd.cpy,
45
- alwaysCopySymbols : Boolean = false ,
46
- )(using Context ) extends tpd.TreeMap (cpy) {
41
+ cpy : tpd.TreeCopier = tpd.cpy)(using Context ) extends tpd.TreeMap (cpy) {
47
42
import tpd .*
48
43
49
44
def copy (
@@ -53,7 +48,7 @@ class TreeTypeMap(
53
48
newOwners : List [Symbol ],
54
49
substFrom : List [Symbol ],
55
50
substTo : List [Symbol ])(using Context ): TreeTypeMap =
56
- new TreeTypeMap (typeMap, treeMap, oldOwners, newOwners, substFrom, substTo, cpy, alwaysCopySymbols )
51
+ new TreeTypeMap (typeMap, treeMap, oldOwners, newOwners, substFrom, substTo)
57
52
58
53
/** If `sym` is one of `oldOwners`, replace by corresponding symbol in `newOwners` */
59
54
def mapOwner (sym : Symbol ): Symbol = sym.subst(oldOwners, newOwners)
@@ -212,7 +207,7 @@ class TreeTypeMap(
212
207
* between original and mapped symbols.
213
208
*/
214
209
def withMappedSyms (syms : List [Symbol ]): TreeTypeMap =
215
- withMappedSyms(syms, mapSymbols(syms, this , mapAlways = alwaysCopySymbols ))
210
+ withMappedSyms(syms, mapSymbols(syms, this ))
216
211
217
212
/** The tree map with the substitution between originals `syms`
218
213
* and mapped symbols `mapped`. Also goes into mapped classes
@@ -234,10 +229,6 @@ class TreeTypeMap(
234
229
tmap1
235
230
}
236
231
237
- def withAlwaysCopySymbols : TreeTypeMap =
238
- if alwaysCopySymbols then this
239
- else new TreeTypeMap (typeMap, treeMap, oldOwners, newOwners, substFrom, substTo, cpy, alwaysCopySymbols = true )
240
-
241
232
override def toString =
242
233
def showSyms (syms : List [Symbol ]) =
243
234
syms.map(sym => s " $sym# ${sym.id}" ).mkString(" , " )
0 commit comments