Skip to content

Commit 2414033

Browse files
committed
Fix canElideThis condition
1 parent d7e90d5 commit 2414033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
642642
inlineCallPrefix.tpe == tpe && ctx.owner.isContainedIn(tpe.cls)
643643
|| tpe.cls.isContainedIn(inlinedMethod)
644644
|| tpe.cls.is(Package)
645-
|| tpe.cls.isStaticOwner && !(tpe.cls.seesOpaques && ctx.owner.isContainedIn(tpe.cls))
645+
|| tpe.cls.isStaticOwner && !(tpe.cls.seesOpaques && inlinedMethod.isContainedIn(tpe.cls))
646646

647647
/** Very similar to TreeInfo.isPureExpr, but with the following inliner-only exceptions:
648648
* - synthetic case class apply methods, when the case class constructor is empty, are
@@ -743,7 +743,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
743743

744744
private val registerTypes = new TypeTraverser:
745745
override def stopAt = StopAt.Package
746-
override def traverse(t: Type) =
746+
override def traverse(t: Type) =
747747
registerType(t)
748748
traverseChildren(t)
749749

0 commit comments

Comments
 (0)