@@ -513,7 +513,7 @@ class TreeUnpickler(reader: TastyReader,
513
513
val rhsStart = currentAddr
514
514
val rhsIsEmpty = nothingButMods(end)
515
515
if (! rhsIsEmpty) skipTree()
516
- val (givenFlags, annotFns, privateWithin) = readModifiers(end)
516
+ val (givenFlags, annotFns, privateWithin) = readModifiers(end, readAnnot, readWithin, NoSymbol )
517
517
pickling.println(i " creating symbol $name at $start with flags $givenFlags" )
518
518
val flags = normalizeFlags(tag, givenFlags, name, isAbsType, rhsIsEmpty)
519
519
def adjustIfModule (completer : LazyType ) =
@@ -561,10 +561,10 @@ class TreeUnpickler(reader: TastyReader,
561
561
* boundary symbol.
562
562
*/
563
563
def readModifiers [WithinType , AnnotType ]
564
- (end : Addr , readAnnot : Context => AnnotType , readWithin : Context => WithinType , defaultWithin : WithinType )
565
- (implicit ctx : Context ): (FlagSet , List [AnnotType ], WithinType ) = {
564
+ (end : Addr , readAnnot : Context => Symbol => AnnotType , readWithin : Context => WithinType , defaultWithin : WithinType )
565
+ (implicit ctx : Context ): (FlagSet , List [Symbol => AnnotType ], WithinType ) = {
566
566
var flags : FlagSet = EmptyFlags
567
- var annotFns : List [Symbol => Annotation ] = Nil
567
+ var annotFns : List [Symbol => AnnotType ] = Nil
568
568
var privateWithin = defaultWithin
569
569
while (currentAddr.index != end.index) {
570
570
def addFlag (flag : FlagSet ) = {
@@ -633,12 +633,14 @@ class TreeUnpickler(reader: TastyReader,
633
633
val end = readEnd()
634
634
val tp = readType()
635
635
val lazyAnnotTree = readLaterWithOwner(end, rdr => ctx => rdr.readTerm()(ctx))
636
- if (tp.isRef(defn.BodyAnnot ))
637
- LazyBodyAnnotation (implicit ctx => lazyAnnotTree(owner).complete)
638
- else
639
- Annotation .deferredSymAndTree(
640
- implicit ctx => tp.typeSymbol,
641
- implicit ctx => lazyAnnotTree(owner).complete)
636
+
637
+ owner =>
638
+ if (tp.isRef(defn.BodyAnnot ))
639
+ LazyBodyAnnotation (implicit ctx => lazyAnnotTree(owner).complete)
640
+ else
641
+ Annotation .deferredSymAndTree(
642
+ implicit ctx => tp.typeSymbol,
643
+ implicit ctx => lazyAnnotTree(owner).complete)
642
644
}
643
645
644
646
/** Create symbols for the definitions in the statement sequence between
@@ -1267,7 +1269,7 @@ class TreeUnpickler(reader: TastyReader,
1267
1269
def readMods (): untpd.Modifiers = {
1268
1270
val (flags, annots, privateWithin) =
1269
1271
readModifiers(end, readUntypedAnnot, readUntypedWithin, EmptyTypeName )
1270
- untpd.Modifiers (flags, privateWithin, annots)
1272
+ untpd.Modifiers (flags, privateWithin, annots.map(_( NoSymbol )) )
1271
1273
}
1272
1274
1273
1275
def readRhs (): untpd.Tree =
@@ -1386,8 +1388,8 @@ class TreeUnpickler(reader: TastyReader,
1386
1388
private val readUntypedWithin : Context => TypeName =
1387
1389
implicit ctx => readName().toTypeName
1388
1390
1389
- private val readUntypedAnnot : Context => untpd.Tree =
1390
- implicit ctx => readUntyped()
1391
+ private val readUntypedAnnot : Context => Symbol => untpd.Tree =
1392
+ implicit ctx => _ => readUntyped()
1391
1393
1392
1394
// ------ Setting positions ------------------------------------------------
1393
1395
0 commit comments