aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-16 13:20:19 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-16 16:42:54 +0200
commitbb940560529ba460af4caa967caaa7f34f944b04 (patch)
tree5eb4ff7ba0bfaf171e3d26bf8dddfeb86ddc80ef /src/dotty/tools/dotc/core/SymDenotations.scala
parent78fae1152a7b381af4639d3d66ed637eac3ca9d0 (diff)
downloaddotty-bb940560529ba460af4caa967caaa7f34f944b04.tar.gz
dotty-bb940560529ba460af4caa967caaa7f34f944b04.tar.bz2
dotty-bb940560529ba460af4caa967caaa7f34f944b04.zip
Avoid spurious StaleSymbol error in <refinement> members
Refinement classes and their members could give spurious stale symbol errors if the symbol is loaded in a different run than the classfile containing it. The problem is that refinement classes do not form part of the scope of their owners. The fix assumes that refinement classes are always "stillValid".
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index d2b0d5030..fb26b2540 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -40,7 +40,7 @@ trait SymDenotations { this: Context =>
}
def stillValid(denot: SymDenotation): Boolean =
- if (denot is ValidForever) true
+ if (denot.is(ValidForever) || denot.isRefinementClass) true
else {
val initial = denot.initial
if (initial ne denot)
@@ -49,6 +49,7 @@ trait SymDenotations { this: Context =>
val owner = denot.owner.denot
stillValid(owner) && (
!owner.isClass
+ || owner.isRefinementClass
|| (owner.unforcedDecls.lookupAll(denot.name) contains denot.symbol)
|| denot.isSelfSym)
} catch {