dotty.tools.dotc.util.EnumFlags.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala3-compiler_3 Show documentation
Show all versions of scala3-compiler_3 Show documentation
scala3-compiler-bootstrapped
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