@@ -536,7 +536,7 @@ class TreePickler(pickler: TastyPickler) {
536
536
pickleTree(tp)
537
537
case Annotated (tree, annot) =>
538
538
writeByte(ANNOTATEDtpt )
539
- withLength { pickleTree(tree); pickleTree(annot.tree ) }
539
+ withLength { pickleTree(tree); pickleTree(annot) }
540
540
case LambdaTypeTree (tparams, body) =>
541
541
writeByte(LAMBDAtpt )
542
542
withLength { pickleParams(tparams); pickleTree(body) }
@@ -577,15 +577,24 @@ class TreePickler(pickler: TastyPickler) {
577
577
578
578
def pickleModifiers (sym : Symbol )(implicit ctx : Context ): Unit = {
579
579
import Flags ._
580
- val flags = sym.flags
580
+ var flags = sym.flags
581
581
val privateWithin = sym.privateWithin
582
582
if (privateWithin.exists) {
583
583
writeByte(if (flags is Protected ) PROTECTEDqualified else PRIVATEqualified )
584
584
pickleType(privateWithin.typeRef)
585
+ flags = flags &~ Protected
585
586
}
587
+ if ((flags is ParamAccessor ) && sym.isTerm && ! sym.isSetter)
588
+ flags = flags &~ ParamAccessor // we only generate a tag for parameter setters
589
+ pickleFlags(flags, sym.isTerm)
590
+ sym.annotations.foreach(pickleAnnotation(sym, _))
591
+ }
592
+
593
+ def pickleFlags (flags : Flags .FlagSet , isTerm : Boolean )(implicit ctx : Context ): Unit = {
594
+ import Flags ._
586
595
if (flags is Private ) writeByte(PRIVATE )
587
- if (flags is Protected ) if ( ! privateWithin.exists) writeByte(PROTECTED )
588
- if (( flags is Final ) && ! (sym is Module )) writeByte(FINAL )
596
+ if (flags is Protected ) writeByte(PROTECTED )
597
+ if (flags.is( Final , butNot = Module )) writeByte(FINAL )
589
598
if (flags is Case ) writeByte(CASE )
590
599
if (flags is Override ) writeByte(OVERRIDE )
591
600
if (flags is Inline ) writeByte(INLINE )
@@ -598,7 +607,7 @@ class TreePickler(pickler: TastyPickler) {
598
607
if (flags is Synthetic ) writeByte(SYNTHETIC )
599
608
if (flags is Artifact ) writeByte(ARTIFACT )
600
609
if (flags is Scala2x ) writeByte(SCALA2X )
601
- if (sym. isTerm) {
610
+ if (isTerm) {
602
611
if (flags is Implicit ) writeByte(IMPLICIT )
603
612
if (flags is Erased ) writeByte(ERASED )
604
613
if (flags.is(Lazy , butNot = Module )) writeByte(LAZY )
@@ -608,7 +617,7 @@ class TreePickler(pickler: TastyPickler) {
608
617
if (flags is CaseAccessor ) writeByte(CASEaccessor )
609
618
if (flags is DefaultParameterized ) writeByte(DEFAULTparameterized )
610
619
if (flags is Stable ) writeByte(STABLE )
611
- if (( flags is ParamAccessor ) && sym.isSetter ) writeByte(PARAMsetter )
620
+ if (flags is ParamAccessor ) writeByte(PARAMsetter )
612
621
if (flags is Label ) writeByte(LABEL )
613
622
} else {
614
623
if (flags is Sealed ) writeByte(SEALED )
@@ -617,7 +626,6 @@ class TreePickler(pickler: TastyPickler) {
617
626
if (flags is Covariant ) writeByte(COVARIANT )
618
627
if (flags is Contravariant ) writeByte(CONTRAVARIANT )
619
628
}
620
- sym.annotations.foreach(pickleAnnotation(sym, _))
621
629
}
622
630
623
631
private def isUnpicklable (owner : Symbol , ann : Annotation )(implicit ctx : Context ) = ann match {
0 commit comments