@@ -416,6 +416,15 @@ object Flags {
416
416
417
417
// --------- Combined Flag Sets and Conjunctions ----------------------
418
418
419
+ /** All possible flags */
420
+ val AnyFlags : FlagSet = flagRange(FirstFlag , MaxFlag )
421
+
422
+ /** These flags are pickled */
423
+ val PickledFlags : FlagSet = flagRange(FirstFlag , FirstNotPickledFlag )
424
+
425
+ /** Flags representing access rights */
426
+ val AccessFlags : FlagSet = Local | Private | Protected
427
+
419
428
/** Flags representing source modifiers */
420
429
private val CommonSourceModifierFlags : FlagSet =
421
430
commonFlags(Private , Protected , Final , Case , Implicit , Implied , Given , Override , JavaStatic )
@@ -432,11 +441,6 @@ object Flags {
432
441
TermSourceModifierFlags .toCommonFlags |
433
442
commonFlags(Module , Param , Synthetic , Package , Local , Mutable , Trait )
434
443
435
- assert(ModifierFlags .isTermFlags && ModifierFlags .isTypeFlags)
436
-
437
- /** Flags representing access rights */
438
- val AccessFlags : FlagSet = Private | Protected | Local
439
-
440
444
/** Flags that are not (re)set when completing the denotation
441
445
* TODO: Should check that FromStartFlags do not change in completion
442
446
*/
@@ -448,7 +452,6 @@ object Flags {
448
452
Extension , NonMember , Implicit , Given , Implied , Permanent , Synthetic ,
449
453
SuperAccessorOrScala2x , Inline )
450
454
451
-
452
455
/** Flags that are not (re)set when completing the denotation, or, if symbol is
453
456
* a top-level class or object, when completing the denotation once the class
454
457
* file defining the symbol is loaded (which is generally before the denotation
@@ -464,9 +467,7 @@ object Flags {
464
467
/** Flags that express the variance of a type parameter. */
465
468
val VarianceFlags : FlagSet = Covariant | Contravariant
466
469
467
- /** Flags that are passed from a type parameter of a class to a refinement symbol
468
- * that sets the type parameter */
469
- val RetainedTypeArgFlags : FlagSet = VarianceFlags | Protected | Local
470
+ // ----- Creation flag sets ----------------------------------
470
471
471
472
/** Modules always have these flags set */
472
473
val ModuleValCreationFlags : FlagSet = ModuleVal | Lazy | Final | StableRealizable
@@ -480,15 +481,23 @@ object Flags {
480
481
/** Pure interfaces always have these flags */
481
482
val PureInterfaceCreationFlags : FlagSet = Trait | NoInits | PureInterface
482
483
483
- val NoInitsInterface : FlagSet = NoInits | PureInterface
484
-
485
484
/** The flags of the self symbol */
486
485
val SelfSymFlags : FlagSet = Private | Local | Deferred
487
486
488
487
/** The flags of a class type parameter */
489
488
val ClassTypeParamCreationFlags : FlagSet =
490
489
TypeParam | Deferred | Private | Local
491
490
491
+ /** Packages and package classes always have these flags set */
492
+ val PackageCreationFlags : FlagSet =
493
+ Module | Package | Final | JavaDefined
494
+
495
+ // ----- Retained flag sets ----------------------------------
496
+
497
+ /** Flags that are passed from a type parameter of a class to a refinement symbol
498
+ * that sets the type parameter */
499
+ val RetainedTypeArgFlags : FlagSet = VarianceFlags | Protected | Local
500
+
492
501
/** Flags that can apply to both a module val and a module class, except those that
493
502
* are added at creation anyway
494
503
*/
@@ -505,50 +514,39 @@ object Flags {
505
514
/** Flags that can apply to a module class */
506
515
val RetainedModuleClassFlags : FlagSet = RetainedModuleValAndClassFlags | Enum
507
516
508
- /** Packages and package classes always have these flags set */
509
- val PackageCreationFlags : FlagSet =
510
- Module | Package | Final | JavaDefined
517
+ /** Flags retained in export forwarders */
518
+ val RetainedExportFlags = ImplicitOrImpliedOrGiven | Extension
511
519
512
- /** All possible flags */
513
- val AnyFlags : FlagSet = flagRange(FirstFlag , MaxFlag )
520
+ // ------- Other flag sets -------------------------------------
514
521
515
- /** These flags are pickled */
516
- val PickledFlags : FlagSet = flagRange(FirstFlag , FirstNotPickledFlag )
522
+ val NoInitsInterface : FlagSet = NoInits | PureInterface
517
523
518
- /** An abstract class or a trait */
519
524
val AbstractOrTrait : FlagSet = Abstract | Trait
520
525
521
- /** Labeled `private` or `protected[local]` */
522
- val PrivateOrLocal : FlagSet = Private | Local
526
+ val PrivateOrLocal : FlagSet = Local | Private // Labelled `private` or `protected[local]`
523
527
524
- /** Either a module or a final class */
525
- val ModuleOrFinal : FlagSet = ModuleClass | Final
528
+ val ModuleOrFinal : FlagSet = Final | ModuleClass // A module class or a final class
526
529
527
- /** Either mutable or lazy */
528
- val MutableOrLazy : FlagSet = Mutable | Lazy
530
+ val MutableOrLazy : FlagSet = Lazy | Mutable
529
531
530
- /** Either method or lazy */
531
- val MethodOrLazy : FlagSet = Method | Lazy
532
+ val MethodOrLazy : FlagSet = Lazy | Method
532
533
533
- /** Either method or module */
534
534
val MethodOrModule : FlagSet = Method | Module
535
535
536
536
/** Either method or lazy or deferred */
537
- val MethodOrLazyOrDeferred : FlagSet = Method | Lazy | Deferred
537
+ val MethodOrLazyOrDeferred : FlagSet = Deferred | Lazy | Method
538
538
539
539
/** An inline method or inline argument proxy */
540
540
val InlineOrProxy : FlagSet = Inline | InlineProxy
541
541
542
542
val ImplicitOrImplied : FlagSet = Implicit | Implied
543
- val ImplicitOrImpliedOrGiven : FlagSet = Implicit | Implied | Given
544
- val ImplicitOrGiven : FlagSet = Implicit | Given
543
+ val ImplicitOrImpliedOrGiven : FlagSet = Given | Implicit | Implied
544
+ val ImplicitOrGiven : FlagSet = Given | Implicit
545
545
546
546
val ImpliedOrGiven : FlagSet = Implied | Given
547
547
548
548
val ImplicitOrImpliedOrGivenTerm = ImplicitOrImpliedOrGiven .toTermFlags
549
549
550
- /** Flags retained in export forwarders */
551
- val RetainedExportFlags = ImplicitOrImpliedOrGiven | Extension
552
550
553
551
/** Assumed to be pure */
554
552
val StableOrErased : FlagSet = StableRealizable | Erased
0 commit comments