diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-31 17:59:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-31 18:04:37 +0200 |
commit | 2bfff5e5457223114e24e112aa6715f6a9d0c3f3 (patch) | |
tree | 4a4e4f7a4a0f220c83236eceea8f71c9f83e9e24 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | e7e1cdce8eb25452ed97e8a019cc63aaecab6fc6 (diff) | |
download | dotty-2bfff5e5457223114e24e112aa6715f6a9d0c3f3.tar.gz dotty-2bfff5e5457223114e24e112aa6715f6a9d0c3f3.tar.bz2 dotty-2bfff5e5457223114e24e112aa6715f6a9d0c3f3.zip |
Fix to elidable prefix.
The previous condition was too weak. The fix revealed a problem where
an "undefined symbol" error was thrown when reading an alias annotation
in the unpickler. The exception is now suppressed, the comment explains why.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 376e63c41..c56d2b882 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -576,7 +576,7 @@ object Denotations { //println(s"searching: $cur at $currentPeriod, valid for ${cur.validFor}") cur = cur.nextInRun cnt += 1 - assert(cnt <= MaxPossiblePhaseId, demandOutsideDefinedMsg) + if (cnt > MaxPossiblePhaseId) throw new NotDefinedHere(demandOutsideDefinedMsg) } cur } @@ -890,5 +890,10 @@ object Denotations { util.Stats.record("stale symbol") override def getMessage() = msg } + + class NotDefinedHere(msg: => String) extends Exception { + util.Stats.record("not defined here") + override def getMessage() = msg + } } |