diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 21 |
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`. |