diff options
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 82ee6560d..a2c8af886 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -570,31 +570,14 @@ object Denotations { //println(s"searching: $cur at $currentPeriod, valid for ${cur.validFor}") cur = cur.nextInRun cnt += 1 - if (cnt > MaxPossiblePhaseId) { - println(s"seems to be a loop in Denotations for $this, currentPeriod = $currentPeriod") - printPeriods(this) - assert(false) - } + assert(cnt <= MaxPossiblePhaseId, + s"demanding denotation of $this outside defined interval: defined periods are${definedPeriodsString}") } cur } - } } - private def printPeriods(current: SingleDenotation): Unit = { - print(s"periods for $this:") - var cur = current - var cnt = 0 - do { - print(" " + cur.validFor) - cur = cur.nextInRun - cnt += 1 - if (cnt > MaxPossiblePhaseId) { println(" ..."); return } - } while (cur ne current) - println() - } - /** Install this denotation to be the result of the given denotation transformer. * This is the implementation of the same-named method in SymDenotations. * It's placed here because it needs access to private fields of SingleDenotation. @@ -643,6 +626,20 @@ object Denotations { if (symbol == NoSymbol) symbol.toString else s"<SingleDenotation of type $infoOrCompleter>" + + def definedPeriodsString: String = { + var sb = new StringBuilder() + var cur = this + var cnt = 0 + do { + sb.append(" " + cur.validFor) + cur = cur.nextInRun + cnt += 1 + if (cnt > MaxPossiblePhaseId) { sb.append(" ..."); cur = this } + } while (cur ne this) + sb.toString + } + // ------ PreDenotation ops ---------------------------------------------- final def first = this |