From 4822da28b769484f9dac3ec83d437149e0559a48 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 21 Jan 2013 14:24:32 +0100 Subject: Changed NamedType dereferencing so that we need not keep track of name validity periods. Instead, we simply retry on missing member lookup in an earlier phase. This scheme is less complicated and works as long as names that are renamed in phase A are not re-used in a phase B >= A. --- src/dotty/tools/dotc/core/Denotations.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/Denotations.scala') diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index f9c4fde8f..77ae86fd6 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -331,7 +331,9 @@ object Denotations { // --------------- DenotationSets ------------------------------------------------- - /** A DenotationSet represents a set of denotation */ + /** A DenotationSet represents a set of single denotations + * It is used as an optimization to avoid forming MultiDenotations too eagerly. + */ trait DenotationSet { def exists: Boolean def toDenot(implicit ctx: Context): Denotation @@ -348,7 +350,7 @@ object Denotations { } case class DenotUnion(denots1: DenotationSet, denots2: DenotationSet) extends DenotationSet { - assert(denots1.exists && !denots2.exists) + assert(denots1.exists && denots2.exists) private def derivedUnion(s1: DenotationSet, s2: DenotationSet) = if (!s1.exists) s2 else if (!s2.exists) s1 -- cgit v1.2.3