aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Mode.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-01 13:51:12 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-01 13:52:07 +0200
commit2788547565d178f9bca93adc0df69029024bf4e6 (patch)
treec3fe449fda762b28d14db563678644ff56fe885c /src/dotty/tools/dotc/typer/Mode.scala
parentdc958b7773249105224f667bdd83154235efe79b (diff)
downloaddotty-2788547565d178f9bca93adc0df69029024bf4e6.tar.gz
dotty-2788547565d178f9bca93adc0df69029024bf4e6.tar.bz2
dotty-2788547565d178f9bca93adc0df69029024bf4e6.zip
Allow more leniency in time travel.
Makes the method pioneered in elidablePrefix more general. Also applies it to accessWithin.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Mode.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Mode.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Mode.scala b/src/dotty/tools/dotc/typer/Mode.scala
index 417d461e1..eb911987b 100644
--- a/src/dotty/tools/dotc/typer/Mode.scala
+++ b/src/dotty/tools/dotc/typer/Mode.scala
@@ -34,5 +34,17 @@ object Mode {
val TypevarsMissContext = newMode(4, "TypevarsMissContext")
val CheckCyclic = newMode(5, "CheckCyclic")
+ /** This mode bit is set if we want to allow accessing a symbol's denotation
+ * at a period before that symbol is first valid. An example where this is
+ * the case is if we want to examine the environment where an access is made.
+ * The computation might take place at an earlier phase (e.g. it is part of
+ * some completion such as unpickling), but the environment might contain
+ * synbols that are not yet defined in that phase.
+ * If the mode bit is set, getting the denotation of a symbol at a phase
+ * before the symbol is defined will return the symbol's denotation at the
+ * first phase where it is valid, instead of throwing a NotDefinedHere error.
+ */
+ val FutureDefsOK = newMode(6, "FutureDefsOK")
+
val PatternOrType = Pattern | Type
} \ No newline at end of file