diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-02 17:20:51 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-04-07 23:43:15 +0200 |
commit | 553e89bf5979c7ed5436aa9581fbc3c0f46fdc5c (patch) | |
tree | ae1dee3ece8926dfeddf9272c558e33e0668c034 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | e1e0e9abb6c2b6285d598e260cc1d1c4ac2d3c2a (diff) | |
download | dotty-553e89bf5979c7ed5436aa9581fbc3c0f46fdc5c.tar.gz dotty-553e89bf5979c7ed5436aa9581fbc3c0f46fdc5c.tar.bz2 dotty-553e89bf5979c7ed5436aa9581fbc3c0f46fdc5c.zip |
Use invalidateInheritedSymbols instead of syncWithParents
syncWithParents explores the denotations of symbols that might yet to be entered
in the current run. If such a symbol is looked at in a new run before a new one
is entered, the validty period of the old denotation is extended to the new run
and consequently references to that symbol do not know they need to reload. This
pollutes the cache of references and causes StaleSymbol errors down the line.
Replacing with invalidateInheritedSymbols avoids the problem.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 6ca1bae8f..ceb996171 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -493,6 +493,9 @@ object Denotations { b.toList } + /** Invalidate all caches and fields that depend on base classes and their contents */ + def invalidateInheritedInfo(): Unit = () + /** Move validity period of this denotation to a new run. Throw a StaleSymbol error * if denotation is no longer valid. */ @@ -502,9 +505,10 @@ object Denotations { var d: SingleDenotation = denot do { d.validFor = Period(ctx.period.runId, d.validFor.firstPhaseId, d.validFor.lastPhaseId) + d.invalidateInheritedInfo() d = d.nextInRun } while (d ne denot) - syncWithParents + this case _ => if (coveredInterval.containsPhaseId(ctx.phaseId)) staleSymbolError else NoDenotation |