aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala5
-rw-r--r--src/dotty/tools/dotc/core/Types.scala8
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala4
3 files changed, 10 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index e6d5023e5..90a6a373c 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -479,7 +479,7 @@ object Denotations {
} while (d ne denot)
initial.copyIfParentInvalid
case _ =>
- throw new Error(s"stale symbol; $this, defined in run ${valid.runId} is referred to in run ${currentPeriod.runId}")
+ staleSymbolError
}
if (valid.runId != currentPeriod.runId) bringForward.current
else {
@@ -523,6 +523,9 @@ object Denotations {
}
}
+ def staleSymbolError(implicit ctx: Context) =
+ throw new Error(s"stale symbol; $this, defined in run ${myValidFor.runId} is referred to in run ${ctx.period.runId}")
+
/** For ClassDenotations only:
* If caches influenced by parent classes are still valid, the denotation
* itself, otherwise a freshly initialized copy.
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 2a6a5017f..28a7f9e67 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1018,8 +1018,12 @@ object Types {
case null =>
val sym = lastSymbol
if (sym == null) loadDenot else denotOfSym(sym)
- case d: SymDenotation if ctx.stillValid(d) =>
- d.current
+ case d: SymDenotation =>
+ if (ctx.stillValid(d)) d.current
+ else {
+ val newd = loadDenot
+ if (newd.exists) newd else d.staleSymbolError
+ }
case d =>
if (d.validFor.runId == ctx.period.runId) d.current
else loadDenot
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index a153f9066..868276598 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -204,10 +204,6 @@ object Inferencing {
*/
abstract case class ViewProto(argType: Type, override val resultType: Type)(implicit ctx: Context)
extends CachedGroundType with ApplyingProto {
- // def lookingForInfo = resultType match {
- // case rt: SelectionProto => rt.name.toString == "info"
- // case _ => false
- // }
def isMatchedBy(tp: Type)(implicit ctx: Context): Boolean = /*ctx.conditionalTraceIndented(lookingForInfo, i"?.info isMatchedBy $tp ${tp.getClass}")*/ {
ctx.typer.isApplicable(tp, argType :: Nil, resultType)
}