@@ -178,25 +178,25 @@ class TreeTypeMap(
178
178
* and return a treemap that contains the substitution
179
179
* between original and mapped symbols.
180
180
*/
181
- def withMappedSyms (syms : List [Symbol ], mapAlways : Boolean = false ): TreeTypeMap =
182
- withMappedSyms(syms, mapSymbols(syms, this , mapAlways ))
181
+ def withMappedSyms (syms : List [Symbol ]): TreeTypeMap =
182
+ withMappedSyms(syms, mapSymbols(syms, this ))
183
183
184
184
/** The tree map with the substitution between originals `syms`
185
185
* and mapped symbols `mapped`. Also goes into mapped classes
186
186
* and substitutes their declarations.
187
187
*/
188
188
def withMappedSyms (syms : List [Symbol ], mapped : List [Symbol ]): TreeTypeMap =
189
- val symsChanged = syms ne mapped
190
- val substMap = withSubstitution(syms, mapped)
191
- lazy val origCls = mapped.zip (syms).filter(_._1.isClass).toMap
192
- mapped.filter(_.isClass).foldLeft(substMap) { (tmap, cls) =>
193
- val origDcls = cls.info.decls.toList.filterNot (_.is( TypeParam ))
194
- val mappedDcls = mapSymbols(origDcls, tmap )
195
- val tmap1 = tmap.withMappedSyms(
196
- origCls(cls).typeParams ::: origDcls,
197
- cls.typeParams ::: mappedDcls)
198
- if symsChanged then
189
+ if syms eq mapped then this
190
+ else
191
+ val substMap = withSubstitution (syms, mapped)
192
+ lazy val origCls = mapped.zip(syms). filter(_._1. isClass).toMap
193
+ mapped.filter (_.isClass).foldLeft(substMap) { (tmap, cls) =>
194
+ val origDcls = cls.info.decls.toList.filterNot(_.is( TypeParam ) )
195
+ val mappedDcls = mapSymbols(origDcls, tmap, mapAlways = true )
196
+ val tmap1 = tmap.withMappedSyms(
197
+ origCls( cls) .typeParams ::: origDcls,
198
+ cls.typeParams ::: mappedDcls)
199
199
origDcls.lazyZip(mappedDcls).foreach(cls.asClass.replace)
200
- tmap1
201
- }
200
+ tmap1
201
+ }
202
202
}
0 commit comments