@@ -465,7 +465,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
465
465
if (isByName) DefDef (boundSym, newArg)
466
466
else ValDef (boundSym, newArg)
467
467
}.withSpan(boundSym.span)
468
- bindingsBuf += binding.setDefTree
468
+ bindingsBuf += binding
469
469
binding
470
470
}
471
471
@@ -522,7 +522,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
522
522
ref(rhsClsSym.sourceModule)
523
523
else
524
524
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)
526
526
bindingsBuf += binding
527
527
inlining.println(i " proxy at $level: $selfSym = ${bindingsBuf.last}" )
528
528
lastSelf = selfSym
@@ -798,7 +798,12 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
798
798
bindingsBuf.mapInPlace { binding =>
799
799
// Set trees to symbols allow macros to see the definition tree.
800
800
// 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
802
807
}
803
808
804
809
// 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) {
1383
1388
if Inliner .needsInlining(tree) then Inliner .inlineCall(tree)
1384
1389
else tree
1385
1390
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
1386
1395
}
1387
1396
1388
1397
/** Drop any side-effect-free bindings that are unused in expansion or other reachable bindings.
0 commit comments