Skip to content

Commit c534807

Browse files
committed
Simplify TreeTypeMap#withMappedSyms more
1 parent f6ffe67 commit c534807

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ class TreeTypeMap(
185185
* and mapped symbols `mapped`. Also goes into mapped classes
186186
* and substitutes their declarations.
187187
*/
188-
def withMappedSyms(syms: List[Symbol], mapped: List[Symbol]): TreeTypeMap = {
188+
def withMappedSyms(syms: List[Symbol], mapped: List[Symbol]): TreeTypeMap =
189189
val symsChanged = syms ne mapped
190190
val substMap = withSubstitution(syms, mapped)
191191
lazy val origCls = mapped.zip(syms).filter(_._1.isClass).toMap
192-
val fullMap = mapped.filter(_.isClass).foldLeft(substMap) { (tmap, cls) =>
192+
mapped.filter(_.isClass).foldLeft(substMap) { (tmap, cls) =>
193193
val origDcls = cls.info.decls.toList.filterNot(_.is(TypeParam))
194194
val mappedDcls = mapSymbols(origDcls, tmap)
195195
val tmap1 = tmap.withMappedSyms(
@@ -199,7 +199,4 @@ class TreeTypeMap(
199199
origDcls.lazyZip(mappedDcls).foreach(cls.asClass.replace)
200200
tmap1
201201
}
202-
if symsChanged || (fullMap eq substMap) then fullMap
203-
else withMappedSyms(syms, mapAlways = true)
204-
}
205202
}

0 commit comments

Comments
 (0)