From ac8b319ed4738b2200350adb3943eb558157e1b7 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 10 Apr 2013 10:07:50 +0200 Subject: 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. --- src/dotty/tools/dotc/core/pickling/UnPickler.scala | 8 ++++---- 1 file 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") -- cgit v1.2.3