Skip to content

Commit 2f21f2f

Browse files
committed
Factor common code in if/then.
1 parent c3526e2 commit 2f21f2f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,11 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) {
366366
case tpe: ThisType
367367
if !ctx.owner.isContainedIn(tpe.cls) && !tpe.cls.is(Package) &&
368368
!thisProxy.contains(tpe.cls) =>
369-
if (tpe.cls.isStaticOwner) {
370-
val proxyName = s"${tpe.cls.name}_module".toTermName
371-
val proxyType = tpe.cls.sourceModule.termRef
372-
thisProxy(tpe.cls) = newSym(proxyName, EmptyFlags, proxyType).termRef
373-
} else {
374-
val proxyName = s"${tpe.cls.name}_this".toTermName
375-
val proxyType = tpe.asSeenFrom(prefix.tpe, meth.owner)
376-
thisProxy(tpe.cls) = newSym(proxyName, EmptyFlags, proxyType).termRef
369+
val proxyName = s"${tpe.cls.name}_this".toTermName
370+
val proxyType = tpe.asSeenFrom(prefix.tpe, meth.owner)
371+
thisProxy(tpe.cls) = newSym(proxyName, EmptyFlags, proxyType).termRef
372+
if (!tpe.cls.isStaticOwner)
377373
registerType(meth.owner.thisType) // make sure we have a base from which to outer-select
378-
}
379374
case tpe: NamedType
380375
if tpe.symbol.is(Param) && tpe.symbol.owner == meth &&
381376
!paramProxy.contains(tpe) =>

0 commit comments

Comments
 (0)