aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Modes.scala
blob: edcbc79b415ed6209a8b1b5cf1be75bfeb3f6b26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)


}