Skip to content

Commit 3dc1129

Browse files
committed
Be lenient for length of outer selection
1 parent e66f108 commit 3dc1129

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ object Potentials {
110110
* and may be potentially faster.
111111
*/
112112
case class Outer(pot: Potential, classSymbol: ClassSymbol)(val source: Tree) extends Potential {
113-
def size: Int = 1 + pot.size
113+
// be lenient with size of outer selection, no worry for non-termination
114+
def size: Int = pot.size
114115
def show(using Context): String = pot.show + ".outer[" + classSymbol.show + "]"
115116
}
116117

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ object Summarization {
259259
else {
260260
val pot2 = Outer(pot, cur)(pot.source)
261261
val enclosing = cur.owner.lexicallyEnclosingClass.asClass
262+
assert(!enclosing.is(Flags.Package), "enclosing = " + enclosing.show + ", cls = " + cls.show + ", pot = " + pot.show + ", cur = " + cur.show)
262263
resolveThis(cls, pot2, enclosing, source)
263264
}
264265
}

0 commit comments

Comments
 (0)