Skip to content

Commit 2741d0a

Browse files
committed
changeOwner of rhs of slef-valdef (should fix scala#11251)
1 parent f42279d commit 2741d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
501501
ref(rhsClsSym.sourceModule)
502502
else
503503
inlineCallPrefix
504-
val binding = ValDef(selfSym.asTerm, rhs).withSpan(selfSym.span).setDefTree
504+
val binding = ValDef(selfSym.asTerm, rhs.changeOwner(ctx.owner,selfSym)).withSpan(selfSym.span).setDefTree
505505
bindingsBuf += binding
506506
inlining.println(i"proxy at $level: $selfSym = ${bindingsBuf.last}")
507507
lastSelf = selfSym

0 commit comments

Comments
 (0)