aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-04 13:20:14 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:14 +0100
commitfe48a0c4d84aa6f5b4b33cc8db6b10fe03f9a444 (patch)
tree7572408e66e62335eaef4dec30e60ab776a5dbd8 /src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
parent60220781967de8c7efafe1e1b6ed09ae482a8582 (diff)
downloaddotty-fe48a0c4d84aa6f5b4b33cc8db6b10fe03f9a444.tar.gz
dotty-fe48a0c4d84aa6f5b4b33cc8db6b10fe03f9a444.tar.bz2
dotty-fe48a0c4d84aa6f5b4b33cc8db6b10fe03f9a444.zip
Change handling of roots when unpickling
Only roots should have their infos overwritten; other symbols in the root scope should be replaced by same-named symbols in the Tasty file. If we do not do this, we end up with inconsistent caches in root symbols.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
index ded5b8a90..0e0910392 100644
--- a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
@@ -18,11 +18,12 @@ import PositionPickler._
/** Unpickler for typed trees
* @param reader the reader from which to unpickle
* @param tastyName the nametable
+ * @param roots a set of SymDenotations that should be completed by unpickling
* @param totalRange the range position enclosing all returned trees,
or NoPosition if positions should not be unpickled
* @param positions A map from
*/
-class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table,
+class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, roots: Set[SymDenotation],
totalRange: Position, positions: collection.Map[Addr, Position]) {
import dotty.tools.dotc.core.pickling.PickleFormat._
import TastyName._
@@ -306,7 +307,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table,
else new Completer(subReader(start, end))
if (flags is Module) completer = ctx.adjustModuleCompleter(completer, name)
val sym =
- if (prevDenot.exists) {
+ if (roots contains prevDenot) {
println(i"overwriting ${prevDenot.symbol} # ${prevDenot.hashCode}")
prevDenot.info = completer
prevDenot.flags = flags &~ Touched // allow one more completion