aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-15 14:01:16 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-15 14:01:16 +0100
commit2112492ec908019d1515128c68f1c737518cac3c (patch)
treecb0809dde7bc41095c207ad5d2d65bbf8155d611 /src
parent3d9a664e75307410b8845ecc1540a00924867912 (diff)
downloaddotty-2112492ec908019d1515128c68f1c737518cac3c.tar.gz
dotty-2112492ec908019d1515128c68f1c737518cac3c.tar.bz2
dotty-2112492ec908019d1515128c68f1c737518cac3c.zip
Avoid stale symbol errors for package objects
Happened (albeit non-deterministally) when compiling parsing/*.scala
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala5
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 7eea9fd64..8f7725fbe 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -912,7 +912,10 @@ object SymDenotations {
}
if (this is PackageClass) { // replace existing symbols
val entry = mscope.lookupEntry(sym.name)
- if (entry != null) mscope.unlink(entry)
+ if (entry != null) {
+ mscope.unlink(entry)
+ entry.sym.denot = sym.denot // to avoid stale symbols
+ }
}
mscope.enter(sym)
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index 271ae7a85..b454add44 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -314,7 +314,7 @@ object Symbols {
private[this] var lastDenot: SymDenotation = _
/** Set the denotation of this symbol */
- private[Symbols] def denot_=(d: SymDenotation) =
+ private[core] def denot_=(d: SymDenotation) =
lastDenot = d
/** The current denotation of this symbol */