aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-04-04 09:57:15 +0200
committerMartin Odersky <odersky@gmail.com>2013-04-04 09:57:15 +0200
commit9cd15421432871b920d377af86e1cd1b3edb270e (patch)
tree89906915175582a84d44dc56a8df2b2b65539ed9 /src/dotty/tools/dotc/core/Denotations.scala
parent609aeee025eec0bfc6680bf7fe717d0083cfb15b (diff)
downloaddotty-9cd15421432871b920d377af86e1cd1b3edb270e.tar.gz
dotty-9cd15421432871b920d377af86e1cd1b3edb270e.tar.bz2
dotty-9cd15421432871b920d377af86e1cd1b3edb270e.zip
Trying to get at the root of cyclic reference problems.
Part 1: Enabling tracing and avoiding subtype computations in margeDenot.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 08f4c9c57..c0fa46e31 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -227,9 +227,10 @@ object Denotations {
val sym2Eligible = sym2.isAsConcrete(sym1)
val bounds1 = normalize(info1)
val bounds2 = normalize(info2)
- if (sym2Eligible && bounds2 <:< bounds1) denot2
- else if (sym1Eligible && bounds1 <:< bounds2) denot1
- else new JointRefDenotation(
+// if (sym2Eligible && bounds2 <:< bounds1) denot2
+// else if (sym1Eligible && bounds1 <:< bounds2) denot1
+// else
+ new LazyJointRefDenotation(
if (sym2Eligible) sym2 else sym1,
bounds1 & bounds2,
denot1.validFor & denot2.validFor)
@@ -505,6 +506,12 @@ object Denotations {
override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor)
}
+ class LazyJointRefDenotation(val symbol: Symbol, infoFn: => Type, initValidFor: Period) extends SingleDenotation {
+ validFor = initValidFor
+ lazy val info = infoFn
+ override protected def newLikeThis(s: Symbol, i: Type): SingleDenotation = new JointRefDenotation(s, i, validFor)
+ }
+
class ErrorDenotation(implicit ctx: Context) extends SingleDenotation {
override def exists = false
val symbol = NoSymbol