@@ -260,8 +260,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
260
260
if (isByName) DefDef (boundSym, arg.changeOwner(ctx.owner, boundSym))
261
261
else ValDef (boundSym, arg)
262
262
}.withSpan(boundSym.span)
263
- boundSym.defTree = binding
264
- bindingsBuf += binding
263
+ bindingsBuf += binding.setDefTree
265
264
binding
266
265
}
267
266
@@ -313,9 +312,8 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
313
312
ref(rhsClsSym.sourceModule)
314
313
else
315
314
inlineCallPrefix
316
- val binding = ValDef (selfSym.asTerm, rhs).withSpan(selfSym.span)
315
+ val binding = ValDef (selfSym.asTerm, rhs).withSpan(selfSym.span).setDefTree
317
316
bindingsBuf += binding
318
- selfSym.defTree = binding
319
317
inlining.println(i " proxy at $level: $selfSym = ${bindingsBuf.last}" )
320
318
lastSelf = selfSym
321
319
lastLevel = level
@@ -490,11 +488,9 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
490
488
491
489
// The normalized bindings collected in `bindingsBuf`
492
490
bindingsBuf.transform { binding =>
493
- val transformedBinding = reducer.normalizeBinding(binding)(inlineCtx)
494
491
// Set trees to symbols allow macros to see the definition tree.
495
492
// This is used by `underlyingArgument`.
496
- transformedBinding.symbol.defTree = transformedBinding
497
- transformedBinding
493
+ reducer.normalizeBinding(binding)(inlineCtx).setDefTree
498
494
}
499
495
500
496
// Run a typing pass over the inlined tree. See InlineTyper for details.
0 commit comments