@@ -627,9 +627,12 @@ class TreeUnpickler(reader: TastyReader,
627627 val end = readEnd()
628628 val tp = readType()
629629 val lazyAnnotTree = readLater(end, rdr => ctx => rdr.readTerm()(ctx))
630- Annotation .deferredSymAndTree(
631- implicit ctx => tp.typeSymbol,
632- implicit ctx => lazyAnnotTree.complete)
630+ if (tp.isRef(defn.BodyAnnot ))
631+ LazyBodyAnnotation (implicit ctx => lazyAnnotTree.complete)
632+ else
633+ Annotation .deferredSymAndTree(
634+ implicit ctx => tp.typeSymbol,
635+ implicit ctx => lazyAnnotTree.complete)
633636 }
634637
635638 /** Create symbols for the definitions in the statement sequence between
@@ -1239,8 +1242,11 @@ class TreeUnpickler(reader: TastyReader,
12391242 untpd.ByNameTypeTree (readUntyped())
12401243 case NAMEDARG =>
12411244 untpd.NamedArg (readName(), readUntyped())
1245+ case EMPTYTREE =>
1246+ untpd.EmptyTree
12421247 case SHAREDtype =>
1243- assert(readNat() == 0 )
1248+ val b = readNat()
1249+ assert(b == 0 , i " bad shared type $b at $currentAddr when reading ${ctx.owner.ownersIterator.toList}%, % " )
12441250 untpd.TypeTree ()
12451251 case _ =>
12461252 untpd.Literal (readConstant(tag))
@@ -1275,7 +1281,7 @@ class TreeUnpickler(reader: TastyReader,
12751281 case ASSIGN =>
12761282 untpd.Assign (readUntyped(), readUntyped())
12771283 case BLOCK =>
1278- val expr = ifBefore(end)( readUntyped(), untpd. EmptyTree )
1284+ val expr = readUntyped()
12791285 val stats = until(end)(readUntyped())
12801286 untpd.Block (stats, expr)
12811287 case IF =>
@@ -1346,7 +1352,11 @@ class TreeUnpickler(reader: TastyReader,
13461352 untpd.TypedSplice (readTerm())
13471353 case FUNCTION =>
13481354 val body = readUntyped()
1349- val params = until(end)(readUntyped())
1355+ import untpd .modsDeco
1356+ val params = until(end)(readUntyped()).map {
1357+ case param : untpd.ValDef => param.withMods(param.mods | Param )
1358+ case param => param
1359+ }
13501360 untpd.Function (params, body)
13511361 case INFIXOP =>
13521362 untpd.InfixOp (readUntyped(), readIdent(), readUntyped())
0 commit comments