diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-10 10:07:50 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-10 10:07:50 +0200 |
commit | ac8b319ed4738b2200350adb3943eb558157e1b7 (patch) | |
tree | 0252257aec90c0fd3aedd161acb4dabbd29e9f26 /src/dotty | |
parent | c9e3ea57a5ea802b7fb0772fb73da10f5fe59f3e (diff) | |
download | dotty-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.
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 8 |
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") |