aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-10-07 12:21:42 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-12 10:50:26 +0200
commit88007462d3251cdc3032c724dde873eabfed6427 (patch)
tree0fff23518ec3e39a966628f0338b24e5458038f8 /src/dotty/tools/dotc/core/Types.scala
parent939bdf473f31c352a345243effb48bfb01d49b03 (diff)
downloaddotty-88007462d3251cdc3032c724dde873eabfed6427.tar.gz
dotty-88007462d3251cdc3032c724dde873eabfed6427.tar.bz2
dotty-88007462d3251cdc3032c724dde873eabfed6427.zip
Avoid caching NoDenotations in NamedTypes
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 6145bdffb..d93e4eb09 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -1173,7 +1173,12 @@ object Types {
else loadDenot
}
if (ctx.typerState.ephemeral) record("ephemeral cache miss: loadDenot")
- else {
+ else if (d.exists) {
+ // Avoid storing NoDenotations in the cache - we will not be able to recover from
+ // them. The situation might arise that a type has NoDenotation in some later
+ // phase but a defined denotation earlier (e.g. a TypeRef to an abstract type
+ // is undefined after erasure.) We need to be able to do time travel back and
+ // forth also in these cases.
lastDenotation = d
lastSymbol = d.symbol
checkedPeriod = ctx.period