aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.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/core/Denotations.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/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index c56d2b882..507914f85 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -18,6 +18,7 @@ import printing.Texts._
import printing.Printer
import io.AbstractFile
import config.Config
+import typer.Mode
import util.common._
import collection.mutable.ListBuffer
import Decorators.SymbolIteratorDecorator
@@ -576,7 +577,11 @@ object Denotations {
//println(s"searching: $cur at $currentPeriod, valid for ${cur.validFor}")
cur = cur.nextInRun
cnt += 1
- if (cnt > MaxPossiblePhaseId) throw new NotDefinedHere(demandOutsideDefinedMsg)
+ if (cnt > MaxPossiblePhaseId)
+ if (ctx.mode is Mode.FutureDefsOK)
+ return current(ctx.withPhase(coveredInterval.firstPhaseId))
+ else
+ throw new NotDefinedHere(demandOutsideDefinedMsg)
}
cur
}