diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-06 21:53:56 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-06 21:55:17 +0100 |
commit | 0d356254c4d6326398c9c1a587ad193fadef6883 (patch) | |
tree | efca748e4e2278c675a2880cc0b31927272aa6c9 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | ab62ca99a31ccd1984b875f7040b430bfccc2724 (diff) | |
download | dotty-0d356254c4d6326398c9c1a587ad193fadef6883.tar.gz dotty-0d356254c4d6326398c9c1a587ad193fadef6883.tar.bz2 dotty-0d356254c4d6326398c9c1a587ad193fadef6883.zip |
Catch stale references
If a NamedType was denoted a SymDenotation one run, but stops being defined in the next, throw a staleSymbol error.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index e6d5023e5..90a6a373c 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -479,7 +479,7 @@ object Denotations { } while (d ne denot) initial.copyIfParentInvalid case _ => - throw new Error(s"stale symbol; $this, defined in run ${valid.runId} is referred to in run ${currentPeriod.runId}") + staleSymbolError } if (valid.runId != currentPeriod.runId) bringForward.current else { @@ -523,6 +523,9 @@ object Denotations { } } + def staleSymbolError(implicit ctx: Context) = + throw new Error(s"stale symbol; $this, defined in run ${myValidFor.runId} is referred to in run ${ctx.period.runId}") + /** For ClassDenotations only: * If caches influenced by parent classes are still valid, the denotation * itself, otherwise a freshly initialized copy. |