Skip to content

Commit e531634

Browse files
authored
Merge pull request #4082 from dotty-staging/fix-isProvisional
Don't force LazyRefs when computing `isProvisional`
2 parents 14fb071 + 743e8d8 commit e531634

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ object Types {
8888

8989
// ----- Tests -----------------------------------------------------
9090

91-
// debug only: a unique identifier for a type
92-
val uniqId = {
93-
nextId = nextId + 1
91+
// // debug only: a unique identifier for a type
92+
// val uniqId = {
93+
// nextId = nextId + 1
9494
// if (nextId == 19555)
9595
// println("foo")
96-
nextId
97-
}
96+
// nextId
97+
// }
9898

9999
/** A cache indicating whether the type was still provisional, last time we checked */
100100
@sharable private var mightBeProvisional = true
@@ -122,6 +122,8 @@ object Types {
122122
case _ => false
123123
}
124124
}
125+
case t: LazyRef =>
126+
!t.completed || apply(x, t.ref)
125127
case _ =>
126128
foldOver(x, t)
127129
}
@@ -2260,6 +2262,7 @@ object Types {
22602262
myRef
22612263
}
22622264
def evaluating = computed && myRef == null
2265+
def completed = myRef != null
22632266
override def underlying(implicit ctx: Context) = ref
22642267
override def toString = s"LazyRef(${if (computed) myRef else "..."})"
22652268
override def equals(other: Any) = this.eq(other.asInstanceOf[AnyRef])

0 commit comments

Comments
 (0)