@@ -250,9 +250,14 @@ object Flags {
250
250
251
251
final val AccessorOrSealed : FlagSet = Accessor .toCommonFlags
252
252
253
- /** A mutable var */
253
+ /** A mutable var */
254
254
final val Mutable : FlagSet = termFlag(12 , " mutable" )
255
255
256
+ /** An opqaue type */
257
+ final val Opaque : FlagSet = typeFlag(12 , " opaque" )
258
+
259
+ final val MutableOrOpaque : FlagSet = Mutable .toCommonFlags
260
+
256
261
/** Symbol is local to current class (i.e. private[this] or protected[this]
257
262
* pre: Private or Protected are also set
258
263
*/
@@ -263,7 +268,7 @@ object Flags {
263
268
*/
264
269
final val ParamAccessor : FlagSet = termFlag(14 , " <paramaccessor>" )
265
270
266
- /** A value or class implementing a module */
271
+ /** A value or class implementing a module */
267
272
final val Module : FlagSet = commonFlag(15 , " module" )
268
273
final val ModuleVal : FlagSet = Module .toTermFlags
269
274
final val ModuleClass : FlagSet = Module .toTypeFlags
@@ -435,15 +440,20 @@ object Flags {
435
440
// --------- Combined Flag Sets and Conjunctions ----------------------
436
441
437
442
/** Flags representing source modifiers */
438
- final val SourceModifierFlags : FlagSet =
439
- commonFlags(Private , Protected , Abstract , Final , Inline ,
440
- Sealed , Case , Implicit , Override , AbsOverride , Lazy , JavaStatic , Erased )
443
+ private val CommonSourceModifierFlags : FlagSet =
444
+ commonFlags(Private , Protected , Final , Case , Implicit , Override , JavaStatic )
445
+
446
+ final val TypeSourceModifierFlags : FlagSet =
447
+ CommonSourceModifierFlags .toTypeFlags | Abstract | Sealed | Opaque
448
+
449
+ final val TermSourceModifierFlags : FlagSet =
450
+ CommonSourceModifierFlags .toTermFlags | Inline | AbsOverride | Lazy | Erased
441
451
442
452
/** Flags representing modifiers that can appear in trees */
443
453
final val ModifierFlags : FlagSet =
444
- SourceModifierFlags | Module | Param | Synthetic | Package | Local |
445
- commonFlags( Mutable )
446
- // | Trait is subsumed by commonFlags(Lazy) from SourceModifierFlags
454
+ TypeSourceModifierFlags .toCommonFlags |
455
+ TermSourceModifierFlags .toCommonFlags |
456
+ commonFlags( Module , Param , Synthetic , Package , Local , Mutable , Trait )
447
457
448
458
assert(ModifierFlags .isTermFlags && ModifierFlags .isTypeFlags)
449
459
@@ -454,7 +464,7 @@ object Flags {
454
464
final val FromStartFlags : FlagSet =
455
465
Module | Package | Deferred | Method .toCommonFlags |
456
466
HigherKinded .toCommonFlags | Param | ParamAccessor .toCommonFlags |
457
- Scala2ExistentialCommon | Mutable .toCommonFlags | Touched | JavaStatic |
467
+ Scala2ExistentialCommon | MutableOrOpaque | Touched | JavaStatic |
458
468
CovariantOrOuter | ContravariantOrLabel | CaseAccessor .toCommonFlags |
459
469
NonMember | ImplicitCommon | Permanent | Synthetic |
460
470
SuperAccessorOrScala2x | Inline
@@ -516,7 +526,13 @@ object Flags {
516
526
Accessor | AbsOverride | Stable | Captured | Synchronized | Erased
517
527
518
528
/** Flags that can apply to a module class */
519
- final val RetainedModuleClassFlags : FlagSet = RetainedModuleValAndClassFlags | ImplClass | Enum
529
+ final val RetainedModuleClassFlags : FlagSet = RetainedModuleValAndClassFlags |
530
+ ImplClass | Enum | Opaque
531
+
532
+ /** Flags that are copied from a synthetic companion to a user-defined one
533
+ * when the two are merged. See: Namer.mergeCompanionDefs
534
+ */
535
+ final val RetainedSyntheticCompanionFlags : FlagSet = Opaque
520
536
521
537
/** Packages and package classes always have these flags set */
522
538
final val PackageCreationFlags : FlagSet =
@@ -629,6 +645,9 @@ object Flags {
629
645
/** A Java companion object */
630
646
final val JavaModule : FlagConjunction = allOf(JavaDefined , Module )
631
647
648
+ /** An opaque companion object */
649
+ final val OpaqueModule : FlagConjunction = allOf(Opaque , Module )
650
+
632
651
/** A Java companion object */
633
652
final val JavaProtected : FlagConjunction = allOf(JavaDefined , Protected )
634
653
@@ -665,15 +684,18 @@ object Flags {
665
684
/** Java symbol which is `protected` and `static` */
666
685
final val StaticProtected : FlagConjunction = allOf(JavaDefined , Protected , JavaStatic )
667
686
687
+ final val Scala2Trait : FlagConjunction = allOf(Scala2x , Trait )
688
+
668
689
final val AbstractFinal : FlagConjunction = allOf(Abstract , Final )
669
690
final val AbstractSealed : FlagConjunction = allOf(Abstract , Sealed )
691
+ final val AbstractAndOverride : FlagConjunction = allOf(Abstract , Override )
692
+
670
693
final val SyntheticArtifact : FlagConjunction = allOf(Synthetic , Artifact )
671
694
final val SyntheticModule : FlagConjunction = allOf(Synthetic , Module )
672
695
final val SyntheticTermParam : FlagConjunction = allOf(Synthetic , TermParam )
673
696
final val SyntheticTypeParam : FlagConjunction = allOf(Synthetic , TypeParam )
674
697
final val SyntheticCase : FlagConjunction = allOf(Synthetic , Case )
675
- final val AbstractAndOverride : FlagConjunction = allOf(Abstract , Override )
676
- final val Scala2Trait : FlagConjunction = allOf(Scala2x , Trait )
698
+ final val SyntheticOpaque : FlagConjunction = allOf(Synthetic , Opaque )
677
699
678
700
implicit def conjToFlagSet (conj : FlagConjunction ): FlagSet =
679
701
FlagSet (conj.bits)
0 commit comments