aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Modes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Modes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Modes.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Modes.scala b/src/dotty/tools/dotc/typer/Modes.scala
new file mode 100644
index 000000000..edcbc79b4
--- /dev/null
+++ b/src/dotty/tools/dotc/typer/Modes.scala
@@ -0,0 +1,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)
+
+
+} \ No newline at end of file