Skip to content

Commit e3383fb

Browse files
committed
Fix proxy references to modules when inlining
1 parent 4d8fa6d commit e3383fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,12 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) {
421421
val rhs =
422422
if (lastSelf.exists)
423423
ref(lastSelf).outerSelect(lastLevel - level, selfSym.info)
424-
else if (rhsClsSym.is(Module))
424+
else if (rhsClsSym.is(Module) && rhsClsSym.isStatic)
425425
ref(rhsClsSym.sourceModule)
426426
else
427427
prefix
428428
bindingsBuf += ValDef(selfSym.asTerm, rhs)
429+
inlining.println(i"proxy at $level: $selfSym = ${bindingsBuf.last}")
429430
lastSelf = selfSym
430431
lastLevel = level
431432
}

0 commit comments

Comments
 (0)