Skip to content

Commit ad81775

Browse files
committed
Rename stillValid to isValidInRun, add quickpath to it
1 parent a6419fb commit ad81775

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ object Denotations {
486486
* if denotation is no longer valid.
487487
*/
488488
private def bringForward()(implicit ctx: Context): SingleDenotation = this match {
489-
case denot: SymDenotation if ctx.stillValid(denot) =>
489+
case denot: SymDenotation if ctx.isValidInRun(denot) =>
490490
if (denot.exists) assert(ctx.runId > validFor.runId, s"denotation $denot invalid in run ${ctx.runId}. ValidFor: $validFor")
491491
var d: SingleDenotation = denot
492492
do {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@ trait SymDenotations { this: Context =>
3838
result
3939
}
4040

41-
def stillValid(denot: SymDenotation): Boolean =
42-
if (denot is ValidForever) true
41+
def isValidInRun(denot: SymDenotation): Boolean =
42+
if(denot.validFor.runId == this.runId) true
43+
else if (denot is ValidForever) true
4344
else try {
4445
val owner = denot.owner.denot
4546
def isSelfSym = owner.infoOrCompleter match {
4647
case ClassInfo(_, _, _, _, selfInfo) => selfInfo == denot.symbol
4748
case _ => false
4849
}
49-
stillValid(owner) && owner.isClass && (
50-
(owner.decls.lookupAll(denot.name) contains denot.symbol)
51-
|| isSelfSym
50+
isValidInRun(owner) && owner.isClass && (
51+
(owner.decls.lookupAll(denot.name) contains denot.symbol)
52+
|| isSelfSym
5253
)
5354
} catch {
5455
case ex: StaleSymbol => false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ object Types {
10281028
val sym = lastSymbol
10291029
if (sym == null) loadDenot else denotOfSym(sym)
10301030
case d: SymDenotation =>
1031-
if (d.validFor.runId == ctx.runId || ctx.stillValid(d)) d.current
1031+
if (ctx.isValidInRun(d)) d.current
10321032
else {
10331033
val newd = loadDenot
10341034
if (newd.exists) newd else d.staleSymbolError

0 commit comments

Comments
 (0)