Skip to content

Commit 4f19388

Browse files
committed
Fix validity checking refinement
It seems some symbols are valid from NoPhase (0). In any case, we should not check members before typerphase.
1 parent 2f94c3d commit 4f19388

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ trait SymDenotations { this: Context =>
4545
if (denot.is(ValidForever) || denot.isRefinementClass) true
4646
else {
4747
val initial = denot.initial
48-
if ((initial ne denot) || ctx.phaseId != initial.validFor.firstPhaseId)
49-
ctx.withPhase(initial.validFor.firstPhaseId).stillValidInOwner(initial.asSymDenotation)
48+
var firstPhaseId = initial.validFor.firstPhaseId.max(ctx.typerPhase.id)
49+
if ((initial ne denot) || ctx.phaseId != firstPhaseId)
50+
ctx.withPhase(firstPhaseId).stillValidInOwner(initial.asSymDenotation)
5051
else
5152
stillValidInOwner(denot)
5253
}

0 commit comments

Comments
 (0)