diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 8c066cdd0..25721ad74 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -63,26 +63,23 @@ 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 = - try - denot.exists && { + /** A denotation exists really if it exists and does not point to a stale symbol. */ + final def reallyExists(denot: Denotation)(implicit ctx: Context): Boolean = try + denot match { + case denot: SymDenotation => + denot.exists && { + denot.ensureCompleted + !denot.isAbsent + } + case denot: SingleDenotation => val sym = denot.symbol - sym.ensureCompleted - (sym eq NoSymbol) || !sym.isAbsent - } - catch { - case ex: StaleSymbol => false + (sym eq NoSymbol) || reallyExists(sym.denot) + case _ => + true } + catch { + case ex: StaleSymbol => false + } /** The type of a selection with `name` of a tree with type `site`. */ |