aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-01-21 14:24:32 +0100
committerMartin Odersky <odersky@gmail.com>2013-01-21 14:24:32 +0100
commit4822da28b769484f9dac3ec83d437149e0559a48 (patch)
treec3cb89f91f786a375a8ee2c4308a541d8b05be81 /src/dotty/tools/dotc/core/Denotations.scala
parente59b8822f53fa6fad057ac9642d31e4026800bf5 (diff)
downloaddotty-4822da28b769484f9dac3ec83d437149e0559a48.tar.gz
dotty-4822da28b769484f9dac3ec83d437149e0559a48.tar.bz2
dotty-4822da28b769484f9dac3ec83d437149e0559a48.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala6
1 files changed, 4 insertions, 2 deletions
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