aboutsummaryrefslogblamecommitdiff
path: root/src/dotty/tools/dotc/typer/Mode.scala
blob: 11f2ac458bf7dca520a68b4717afdc7fd3485c6e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                       

                        

 
package dotty.tools.dotc.typer

case class Mode(val bits: Int) extends AnyVal {
  def | (that: Mode) = Mode(bits | that.bits)
  def & (that: Mode) = Mode(bits & that.bits)
  def &~ (that: Mode) = Mode(bits & ~that.bits)
  def is (that: Mode) = (bits & that.bits) == that.bits
}

object Mode {
  val None = Mode(1 << 0)

  val Expr = Mode(1 << 1)
  val Pattern = Mode(1 << 2)
  val Type = Mode(1 << 3)

  val Fun = Mode(1 << 4)


}