Skip to content

Commit e199e2d

Browse files
committed
Two fixes to invalidation scheme
- Fix isProvisional condition for TypeVars - Force recomputation via memberDenot in NamedType if previous prefix was provisional
1 parent b601d1b commit e199e2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ object Types {
111111
x || t.mightBeProvisional && {
112112
t.mightBeProvisional = t match {
113113
case t: TypeVar =>
114-
!t.inst.exists
114+
!t.inst.exists || apply(x, t.inst)
115115
case t: TypeRef =>
116116
(t: Type).mightBeProvisional = false // break cycles
117117
t.symbol.is(Provisional) ||
@@ -1691,7 +1691,7 @@ object Types {
16911691
* attempt in `denot` does not yield a denotation.
16921692
*/
16931693
private def denotAt(lastd: Denotation, now: Period)(implicit ctx: Context): Denotation = {
1694-
if (lastd != null && (lastd.validFor contains now)) {
1694+
if (lastd != null && (lastd.validFor contains now) && checkedPeriod != Nowhere) {
16951695
checkedPeriod = now
16961696
lastd
16971697
}
@@ -1731,10 +1731,10 @@ object Types {
17311731
lastDenotation match {
17321732
case lastd0: SingleDenotation =>
17331733
val lastd = lastd0.skipRemoved
1734-
if (lastd.validFor.runId == ctx.runId) finish(lastd.current)
1734+
if (lastd.validFor.runId == ctx.runId && (checkedPeriod != Nowhere)) finish(lastd.current)
17351735
else lastd match {
17361736
case lastd: SymDenotation =>
1737-
if (ctx.stillValid(lastd)) finish(lastd.current)
1737+
if (ctx.stillValid(lastd) && (checkedPeriod != Nowhere)) finish(lastd.current)
17381738
else finish(memberDenot(lastd.initial.name, allowPrivate = false))
17391739
case _ =>
17401740
fromDesignator

0 commit comments

Comments
 (0)