@@ -21,9 +21,6 @@ import Decorators.*
2121 * @param newOwners New owners, replacing previous owners.
2222 * @param substFrom The symbols that need to be substituted.
2323 * @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.
2724 *
2825 * The reason the substitution is broken out from the rest of the type map is
2926 * that all symbols have to be substituted at the same time. If we do not do this,
@@ -41,9 +38,7 @@ class TreeTypeMap(
4138 val newOwners : List [Symbol ] = Nil ,
4239 val substFrom : List [Symbol ] = Nil ,
4340 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) {
4742 import tpd .*
4843
4944 def copy (
@@ -53,7 +48,7 @@ class TreeTypeMap(
5348 newOwners : List [Symbol ],
5449 substFrom : List [Symbol ],
5550 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)
5752
5853 /** If `sym` is one of `oldOwners`, replace by corresponding symbol in `newOwners` */
5954 def mapOwner (sym : Symbol ): Symbol = sym.subst(oldOwners, newOwners)
@@ -212,7 +207,7 @@ class TreeTypeMap(
212207 * between original and mapped symbols.
213208 */
214209 def withMappedSyms (syms : List [Symbol ]): TreeTypeMap =
215- withMappedSyms(syms, mapSymbols(syms, this , mapAlways = alwaysCopySymbols ))
210+ withMappedSyms(syms, mapSymbols(syms, this ))
216211
217212 /** The tree map with the substitution between originals `syms`
218213 * and mapped symbols `mapped`. Also goes into mapped classes
@@ -234,10 +229,6 @@ class TreeTypeMap(
234229 tmap1
235230 }
236231
237- def withAlwaysCopySymbols : TreeTypeMap =
238- if alwaysCopySymbols then this
239- else new TreeTypeMap (typeMap, treeMap, oldOwners, newOwners, substFrom, substTo, cpy, alwaysCopySymbols = true )
240-
241232 override def toString =
242233 def showSyms (syms : List [Symbol ]) =
243234 syms.map(sym => s " $sym# ${sym.id}" ).mkString(" , " )
0 commit comments