@@ -465,7 +465,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
465465 if (isByName) DefDef (boundSym, newArg)
466466 else ValDef (boundSym, newArg)
467467 }.withSpan(boundSym.span)
468- bindingsBuf += binding.setDefTree
468+ bindingsBuf += binding
469469 binding
470470 }
471471
@@ -522,7 +522,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
522522 ref(rhsClsSym.sourceModule)
523523 else
524524 inlineCallPrefix
525- val binding = ValDef (selfSym.asTerm, QuoteUtils .changeOwnerOfTree(rhs, selfSym)).withSpan(selfSym.span).setDefTree
525+ val binding = ValDef (selfSym.asTerm, QuoteUtils .changeOwnerOfTree(rhs, selfSym)).withSpan(selfSym.span)
526526 bindingsBuf += binding
527527 inlining.println(i " proxy at $level: $selfSym = ${bindingsBuf.last}" )
528528 lastSelf = selfSym
@@ -798,7 +798,12 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
798798 bindingsBuf.mapInPlace { binding =>
799799 // Set trees to symbols allow macros to see the definition tree.
800800 // This is used by `underlyingArgument`.
801- reducer.normalizeBinding(binding)(using inlineCtx).setDefTree
801+ val binding1 = reducer.normalizeBinding(binding)(using inlineCtx).setDefTree
802+ binding1.foreachSubTree {
803+ case tree : MemberDef => tree.setDefTree
804+ case _ =>
805+ }
806+ binding1
802807 }
803808
804809 // Run a typing pass over the inlined tree. See InlineTyper for details.
@@ -1383,6 +1388,10 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
13831388 if Inliner .needsInlining(tree) then Inliner .inlineCall(tree)
13841389 else tree
13851390
1391+ override def typedUnadapted (tree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree =
1392+ super .typedUnadapted(tree, pt, locked) match
1393+ case member : MemberDef => member.setDefTree
1394+ case tree => tree
13861395 }
13871396
13881397 /** Drop any side-effect-free bindings that are unused in expansion or other reachable bindings.
0 commit comments