diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-10 21:03:16 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-10 21:03:24 +0100 |
commit | e895249de8f59e5a5c4175b428193fa4c5ea90af (patch) | |
tree | a69c66a1c977f8ac0a7ff09a31b99d4878538343 /src/dotty/tools/dotc/typer | |
parent | ada0febcb0893ff8f87d01f605a43f731e38a0be (diff) | |
parent | 5870fbb7297b1b4bb70cbcf27cd88d4e12197234 (diff) | |
download | dotty-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')
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 21 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index f40b63bba..5e5077cc4 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -628,7 +628,7 @@ class SearchHistory(val searchDepth: Int, val seen: Map[ClassSymbol, Int]) { class TermRefSet(implicit ctx: Context) extends mutable.Traversable[TermRef] { import collection.JavaConverters._ private val elems = (new java.util.LinkedHashMap[TermSymbol, List[Type]]).asScala - + def += (ref: TermRef): Unit = { val pre = ref.prefix val sym = ref.symbol.asTerm 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`. |