All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dotc.util.EnumFlags.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
package dotty.tools.dotc.util

object EnumFlags:

  opaque type FlagSet[E <: reflect.Enum] = Int

  object FlagSet:

    extension [E <: reflect.Enum](set: FlagSet[E])
      def is(flag: E): Boolean = (set & (1 << flag.ordinal)) != 0
      def |(flag: E): FlagSet[E] = (set | (1 << flag.ordinal))

    def empty[E <: reflect.Enum]: FlagSet[E] =
      0




© 2015 - 2025 Weber Informatics LLC | Privacy Policy