diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 1bc75e4fec20..c9930e036559 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -5287,17 +5287,6 @@ object Types { protected def mapClassInfo(tp: ClassInfo): Type = derivedClassInfo(tp, this(tp.prefix)) - /** A version of mapClassInfo which also maps parents and self type */ - protected def mapFullClassInfo(tp: ClassInfo): ClassInfo = - tp.derivedClassInfo( - prefix = this(tp.prefix), - declaredParents = tp.declaredParents.mapConserve(this), - selfInfo = tp.selfInfo match { - case tp: Type => this(tp) - case sym => sym - } - ) - def andThen(f: Type => Type): TypeMap = new TypeMap { override def stopAtStatic = thisMap.stopAtStatic def apply(tp: Type) = f(thisMap(tp)) @@ -5308,7 +5297,7 @@ object Types { abstract class DeepTypeMap(using Context) extends TypeMap { override def mapClassInfo(tp: ClassInfo): ClassInfo = { val prefix1 = this(tp.prefix) - val parents1 = tp.parents mapConserve this + val parents1 = tp.declaredParents mapConserve this val selfInfo1: TypeOrSymbol = tp.selfInfo match { case selfInfo: Type => this(selfInfo) case selfInfo => selfInfo diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 81b26246ff85..527928a6a462 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -712,7 +712,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { // the owner from the inlined method to the current owner. val inliner = new TreeTypeMap( typeMap = - new TypeMap { + new DeepTypeMap { def apply(t: Type) = t match { case t: ThisType => thisProxy.getOrElse(t.cls, t) case t: TypeRef => paramProxy.getOrElse(t, mapOver(t)) @@ -721,7 +721,6 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) { else paramProxy.getOrElse(t, mapOver(t)) case t => mapOver(t) } - override def mapClassInfo(tp: ClassInfo) = mapFullClassInfo(tp) }, treeMap = { case tree: This =>