aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-10 21:03:16 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-10 21:03:24 +0100
commite895249de8f59e5a5c4175b428193fa4c5ea90af (patch)
treea69c66a1c977f8ac0a7ff09a31b99d4878538343 /src/dotty/tools/dotc/typer/Typer.scala
parentada0febcb0893ff8f87d01f605a43f731e38a0be (diff)
parent5870fbb7297b1b4bb70cbcf27cd88d4e12197234 (diff)
downloaddotty-e895249de8f59e5a5c4175b428193fa4c5ea90af.tar.gz
dotty-e895249de8f59e5a5c4175b428193fa4c5ea90af.tar.bz2
dotty-e895249de8f59e5a5c4175b428193fa4c5ea90af.zip
Merge branch 'wip/bring-forward': Incremental compilation
1) Make definitions load symbols in current run 2) Change handling of invalid parents. Instead of a copied denotation, we now invalidate the caches of the existing one. (Copying was not enough, as old versions of denotations kept leaking in).
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index f48dfa09b..697441ca1 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -63,12 +63,25 @@ class Typer extends Namer with Applications with Implicits {
*/
private var importedFromRoot: Set[Symbol] = Set()
+ /** A denotation exists really if it exists and does not point to a stale symbol.
+ def reallyExists(denot: Denotation)(implicit ctx: Context): Boolean = denot match {
+ case denot: SymDenotation =>
+ denot.ensureCompleted
+ denot.exists && !denot.isAbsent
+ case _ =>
+ true
+ }*/
+
/** A denotation exists really if it exists and does not point to a stale symbol. */
def reallyExists(denot: Denotation)(implicit ctx: Context): Boolean =
- denot.exists && {
- val sym = denot.symbol
- sym.ensureCompleted
- (sym eq NoSymbol) || !sym.isAbsent
+ try
+ denot.exists && {
+ val sym = denot.symbol
+ sym.ensureCompleted
+ (sym eq NoSymbol) || !sym.isAbsent
+ }
+ catch {
+ case ex: StaleSymbol => false
}
/** The type of a selection with `name` of a tree with type `site`.