diff --git a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala index d3b231788287..98d9a0ca85f6 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala @@ -68,12 +68,12 @@ class TreeTypeMap( } } - val mapType: Type => Type = + def mapType(tp: Type): Type = val substMap = new TypeMap(): def apply(tp: Type): Type = tp match case tp: TermRef if tp.symbol.isImport => mapOver(tp) case tp => tp.substSym(substFrom, substTo) - typeMap.andThen(substMap).andThen(mapOwnerThis) + mapOwnerThis(substMap(typeMap(tp))) end mapType private def updateDecls(prevStats: List[Tree], newStats: List[Tree]): Unit =