From 26881a91ca838708329f6ebdb82b603823a0ad25 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 6 Apr 2015 13:24:20 +0200 Subject: Fix Deferred flag determination when unpickling isAbstractType was wrong because it did not follow through SHARED aliases. This was masked before 1b1fb6e5cf7df42000e378c628c8411bce952eb0 but uncovered afterwards. --- src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala index cea29ce80..cfee3851a 100644 --- a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala +++ b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala @@ -102,6 +102,17 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) { def skipParams(): Unit = while (nextByte == PARAMS || nextByte == TYPEPARAM) skipTree() + /** The next tag, following through SHARED tags */ + def nextUnsharedTag: Int = { + val tag = nextByte + if (tag == SHARED) { + val lookAhead = fork + lookAhead.reader.readByte() + forkAt(lookAhead.reader.readAddr()).nextUnsharedTag + } + else tag + } + def readName(): TermName = toTermName(readNameRef()) def readNameSplitSig()(implicit ctx: Context): Any /* TermName | (TermName, Signature) */ = @@ -352,8 +363,9 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) { var name: Name = toTermName(rawName) if (tag == TYPEDEF || tag == TYPEPARAM) name = name.toTypeName skipParams() - val isAbstractType = nextByte == TYPEBOUNDS - val isClass = nextByte == TEMPLATE + val ttag = nextUnsharedTag + val isAbstractType = ttag == TYPEBOUNDS + val isClass = ttag == TEMPLATE val templateStart = currentAddr skipTree() // tpt val rhsIsEmpty = noRhs(end) -- cgit v1.2.3