diff options
author | Martin Odersky <odersky@gmail.com> | 2014-10-07 12:21:42 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-10-12 10:50:26 +0200 |
commit | 88007462d3251cdc3032c724dde873eabfed6427 (patch) | |
tree | 0fff23518ec3e39a966628f0338b24e5458038f8 /src/dotty/tools/dotc/core/Types.scala | |
parent | 939bdf473f31c352a345243effb48bfb01d49b03 (diff) | |
download | dotty-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.scala | 7 |
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 |