@@ -525,6 +525,9 @@ object Inlines:
525
525
private val paramAccessorsMapper = ParamAccessorsMapper ()
526
526
private val innerClassNewSyms : mutable.LinkedHashMap [Symbol , Symbol ] = mutable.LinkedHashMap .empty
527
527
528
+ private val childThisType = ctx.owner.thisType
529
+ private val childThisTree = This (ctx.owner.asClass).withSpan(parent.span)
530
+
528
531
def expandDefs (overriddenDecls : Set [Symbol ]): List [Tree ] =
529
532
paramAccessorsMapper.registerParamValuesOf(parent)
530
533
val stats = Inlines .defsToInline(parentSym).filterNot(stat => overriddenDecls.contains(stat.symbol))
@@ -534,17 +537,15 @@ object Inlines:
534
537
535
538
protected class InlineTraitTypeMap extends InlinerTypeMap {
536
539
override def apply (t : Type ) = super .apply(t) match {
537
- case t : ThisType if t.cls == parentSym =>
538
- ctx.owner.thisType
539
- case t =>
540
- mapOver(t)
540
+ case t : ThisType if t.cls == parentSym => childThisType
541
+ case t => mapOver(t)
541
542
}
542
543
}
543
544
544
545
protected class InlineTraitTreeMap extends InlinerTreeMap {
545
546
override def apply (tree : Tree ) = super .apply(tree) match {
546
547
case tree : This if tree.symbol == parentSym =>
547
- Inlined (EmptyTree , Nil , This (ctx.owner.asClass).withSpan(parent.span) ).withSpan(parent.span)
548
+ Inlined (EmptyTree , Nil , childThisTree ).withSpan(parent.span)
548
549
case tree : This =>
549
550
tree.tpe match {
550
551
case thisTpe : ThisType if thisTpe.cls.isInlineTrait =>
@@ -593,7 +594,7 @@ object Inlines:
593
594
inlinedTypeDef(stat, inlinedSym)
594
595
595
596
private def inlinedSym (sym : Symbol , withoutFlags : FlagSet = EmptyFlags )(using Context ): Symbol =
596
- if sym.isClass then inlinedClassSym(sym.asClass, withoutFlags) else inlinedMemberSym(sym, withoutFlags)
597
+ if sym.isClass then inlinedClassSym(sym.asClass, withoutFlags) else inlinedMemberSym(sym, withoutFlags)
597
598
598
599
private def inlinedClassSym (sym : ClassSymbol , withoutFlags : FlagSet = EmptyFlags )(using Context ): ClassSymbol =
599
600
sym.info match {
0 commit comments