aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-04-10 10:07:50 +0200
committerMartin Odersky <odersky@gmail.com>2013-04-10 10:07:50 +0200
commitac8b319ed4738b2200350adb3943eb558157e1b7 (patch)
tree0252257aec90c0fd3aedd161acb4dabbd29e9f26
parentc9e3ea57a5ea802b7fb0772fb73da10f5fe59f3e (diff)
downloaddotty-ac8b319ed4738b2200350adb3943eb558157e1b7.tar.gz
dotty-ac8b319ed4738b2200350adb3943eb558157e1b7.tar.bz2
dotty-ac8b319ed4738b2200350adb3943eb558157e1b7.zip
Turn off preloading of denotations for unpickled symbols.
The previous code was wrong for TypeRefs. Once the missing asSeenFrom(pre) was added, it led to cycles. The conclusion is that we have to compute the info lazily. If the prefix is NoPrefix, this is not possible, and we use a fixedSym instead.
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index 4a5c543a4..1d748ae55 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -603,8 +603,8 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
case SINGLEtpe =>
val pre = readTypeRef()
val sym = readDisambiguatedSymbolRef(_.isParameterless)
- if (isLocal(sym)) TermRef.withSym(pre, sym.asTerm)
- else TermRef.withSig(pre, sym.name.asTermName, NotAMethod).withDenot(sym)
+ if (isLocal(sym) || (pre == NoPrefix)) TermRef.withSym(pre, sym.asTerm)
+ else TermRef.withSig(pre, sym.name.asTermName, NotAMethod)
case SUPERtpe =>
val thistpe = readTypeRef()
val supertpe = readTypeRef()
@@ -632,11 +632,11 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
case _ =>
}
val tycon =
- if (isLocal(sym)) {
+ if (isLocal(sym) || pre == NoPrefix) {
TypeRef.withSym(
if ((pre eq NoPrefix) && (sym is TypeParam)) sym.owner.thisType else pre,
sym.asType)
- } else TypeRef(pre, sym.name.asTypeName).withDenot(sym)
+ } else TypeRef(pre, sym.name.asTypeName)
val args = until(end, readTypeRef)
// if (args.nonEmpty) { // DEBUG
// println(s"reading app type $tycon $args")