@@ -858,64 +858,60 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
858
858
if (flags.is(ParamAccessor ) && sym.isTerm && ! sym.isSetter)
859
859
flags = flags &~ ParamAccessor // we only generate a tag for parameter setters
860
860
pickleFlags(flags, sym.isTerm)
861
- if flags.is(Into ) then
862
- // Temporary measure until we can change TastyFormat to include an INTO tag
863
- pickleAnnotation(sym, mdef, Annotation (defn.SilentIntoAnnot , util.Spans .NoSpan ))
864
861
val annots = sym.annotations.foreach(pickleAnnotation(sym, mdef, _))
865
862
}
866
863
867
- def pickleFlags (flags : FlagSet , isTerm : Boolean )(using Context ): Unit = {
864
+ def pickleFlags (flags : FlagSet , isTerm : Boolean )(using Context ): Unit =
868
865
import Flags .*
869
- def writeModTag (tag : Int ) = {
866
+ def writeModTag (tag : Int ) =
870
867
assert(isModifierTag(tag))
871
868
writeByte(tag)
872
- }
869
+
873
870
if flags.is(Scala2x ) then assert(attributes.scala2StandardLibrary)
874
- if ( flags.is(Private )) writeModTag(PRIVATE )
875
- if ( flags.is(Protected )) writeModTag(PROTECTED )
876
- if ( flags.is(Final , butNot = Module )) writeModTag(FINAL )
877
- if ( flags.is(Case )) writeModTag(CASE )
878
- if ( flags.is(Override )) writeModTag(OVERRIDE )
879
- if ( flags.is(Inline )) writeModTag(INLINE )
880
- if ( flags.is(InlineProxy )) writeModTag(INLINEPROXY )
881
- if ( flags.is(Macro )) writeModTag(MACRO )
882
- if ( flags.is(JavaStatic )) writeModTag(STATIC )
883
- if ( flags.is(Module )) writeModTag(OBJECT )
884
- if ( flags.is(Enum )) writeModTag(ENUM )
885
- if ( flags.is(Local )) writeModTag(LOCAL )
886
- if ( flags.is(Synthetic )) writeModTag(SYNTHETIC )
887
- if ( flags.is(Artifact )) writeModTag(ARTIFACT )
871
+ if flags.is(Private )then writeModTag(PRIVATE )
872
+ if flags.is(Protected )then writeModTag(PROTECTED )
873
+ if flags.is(Final , butNot = Module )then writeModTag(FINAL )
874
+ if flags.is(Case )then writeModTag(CASE )
875
+ if flags.is(Override )then writeModTag(OVERRIDE )
876
+ if flags.is(Inline )then writeModTag(INLINE )
877
+ if flags.is(InlineProxy )then writeModTag(INLINEPROXY )
878
+ if flags.is(Macro )then writeModTag(MACRO )
879
+ if flags.is(JavaStatic )then writeModTag(STATIC )
880
+ if flags.is(Module )then writeModTag(OBJECT )
881
+ if flags.is(Enum )then writeModTag(ENUM )
882
+ if flags.is(Local )then writeModTag(LOCAL )
883
+ if flags.is(Synthetic )then writeModTag(SYNTHETIC )
884
+ if flags.is(Artifact )then writeModTag(ARTIFACT )
888
885
if flags.is(Transparent ) then writeModTag(TRANSPARENT )
889
886
if flags.is(Infix ) then writeModTag(INFIX )
890
887
if flags.is(Invisible ) then writeModTag(INVISIBLE )
891
- if ( flags.is(Erased )) writeModTag(ERASED )
892
- if ( flags.is(Exported )) writeModTag(EXPORTED )
893
- if ( flags.is(Given )) writeModTag(GIVEN )
894
- if ( flags.is(Implicit )) writeModTag(IMPLICIT )
895
- if ( flags.is(Tracked )) writeModTag(TRACKED )
896
- if ( isTerm) {
897
- if ( flags.is(Lazy , butNot = Module )) writeModTag(LAZY )
898
- if ( flags.is(AbsOverride )) { writeModTag(ABSTRACT ); writeModTag(OVERRIDE ) }
899
- if ( flags.is(Mutable )) writeModTag(MUTABLE )
900
- if ( flags.is(Accessor )) writeModTag(FIELDaccessor )
901
- if ( flags.is(CaseAccessor )) writeModTag(CASEaccessor )
902
- if ( flags.is(HasDefault )) writeModTag(HASDEFAULT )
888
+ if flags.is(Erased )then writeModTag(ERASED )
889
+ if flags.is(Exported )then writeModTag(EXPORTED )
890
+ if flags.is(Given )then writeModTag(GIVEN )
891
+ if flags.is(Implicit )then writeModTag(IMPLICIT )
892
+ if flags.is(Tracked )then writeModTag(TRACKED )
893
+ if isTermthen
894
+ if flags.is(Lazy , butNot = Module )then writeModTag(LAZY )
895
+ if flags.is(AbsOverride )then { writeModTag(ABSTRACT ); writeModTag(OVERRIDE ) }
896
+ if flags.is(Mutable )then writeModTag(MUTABLE )
897
+ if flags.is(Accessor )then writeModTag(FIELDaccessor )
898
+ if flags.is(CaseAccessor )then writeModTag(CASEaccessor )
899
+ if flags.is(HasDefault )then writeModTag(HASDEFAULT )
903
900
if flags.isAllOf(StableMethod ) then writeModTag(STABLE ) // other StableRealizable flag occurrences are either implied or can be recomputed
904
- if (flags.is(Extension )) writeModTag(EXTENSION )
905
- if (flags.is(ParamAccessor )) writeModTag(PARAMsetter )
906
- if (flags.is(SuperParamAlias )) writeModTag(PARAMalias )
907
- assert(! (flags.is(Label )))
908
- }
909
- else {
910
- if (flags.is(Sealed )) writeModTag(SEALED )
911
- if (flags.is(Abstract )) writeModTag(ABSTRACT )
912
- if (flags.is(Trait )) writeModTag(TRAIT )
913
- if (flags.is(Covariant )) writeModTag(COVARIANT )
914
- if (flags.is(Contravariant )) writeModTag(CONTRAVARIANT )
915
- if (flags.is(Opaque )) writeModTag(OPAQUE )
916
- if (flags.is(Open )) writeModTag(OPEN )
917
- }
918
- }
901
+ if flags.is(Extension ) then writeModTag(EXTENSION )
902
+ if flags.is(ParamAccessor ) then writeModTag(PARAMsetter )
903
+ if flags.is(SuperParamAlias ) then writeModTag(PARAMalias )
904
+ assert(! flags.is(Label ))
905
+ else
906
+ if flags.is(Sealed ) then writeModTag(SEALED )
907
+ if flags.is(Abstract ) then writeModTag(ABSTRACT )
908
+ if flags.is(Trait ) then writeModTag(TRAIT )
909
+ if flags.is(Covariant ) then writeModTag(COVARIANT )
910
+ if flags.is(Contravariant ) then writeModTag(CONTRAVARIANT )
911
+ if flags.is(Opaque ) then writeModTag(OPAQUE )
912
+ if flags.is(Open ) then writeModTag(OPEN )
913
+ if flags.is(Into ) then writeModTag(INTO )
914
+ end pickleFlags
919
915
920
916
private def isUnpicklable (owner : Symbol , ann : Annotation )(using Context ) = ann match {
921
917
case Annotation .Child (sym) => sym.isInaccessibleChildOf(owner)
0 commit comments