aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
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