Skip to content

Commit d35d098

Browse files
committed
Remove code for impossible or ill cases
1 parent 7602f43 commit d35d098

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Summarization.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ object Summarization {
253253

254254
def resolveThis(cls: ClassSymbol, pot: Potential, cur: ClassSymbol, source: Tree)(implicit env: Env): Summary =
255255
trace("resolve " + cls.show + ", pot = " + pot.show + ", cur = " + cur.show, init, s => Summary.show(s.asInstanceOf[Summary])) {
256-
val enclosing = cur.owner.lexicallyEnclosingClass.asClass
257256
if (cls.is(Flags.Package)) (Potentials.empty, Effects.empty)
258-
else if (cls == cur || enclosing.is(Flags.Package)) (pot.toPots, Effects.empty)
257+
else if (cls == cur) (pot.toPots, Effects.empty)
259258
else if (pot.size > 2) (Potentials.empty, Promote(pot)(source).toEffs)
260259
else {
261260
val pot2 = Outer(pot, cur)(pot.source)
261+
val enclosing = cur.owner.lexicallyEnclosingClass.asClass
262262
resolveThis(cls, pot2, enclosing, source)
263263
}
264264
}

0 commit comments

Comments
 (0)