aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/unpickleScala2
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-09 19:36:46 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-09 19:36:46 +0100
commit949c48e0f325afa29ebc70e94de17d525b26386e (patch)
treea8233e3d039101662331bf3a8f232bcf8c871f0b /src/dotty/tools/dotc/core/unpickleScala2
parentb112b2b7c5caa11675242e7c79fe0461673e7668 (diff)
downloaddotty-949c48e0f325afa29ebc70e94de17d525b26386e.tar.gz
dotty-949c48e0f325afa29ebc70e94de17d525b26386e.tar.bz2
dotty-949c48e0f325afa29ebc70e94de17d525b26386e.zip
Get more info on Heisenbugs
1) Check that searched scope is consistent 2) Do a linear search for symbol with name, and report if something was found that way.
Diffstat (limited to 'src/dotty/tools/dotc/core/unpickleScala2')
-rw-r--r--src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
index af34371b7..709270994 100644
--- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
+++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
@@ -383,6 +383,9 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
if (sym.exists || owner.ne(defn.ObjectClass)) sym else declIn(defn.AnyClass)
}
+ def slowSearch(name: Name): Symbol =
+ owner.info.decls.find(_.name == name).getOrElse(NoSymbol)
+
def nestedObjectSymbol: Symbol = {
// If the owner is overloaded (i.e. a method), it's not possible to select the
// right member, so return NoSymbol. This can only happen when unpickling a tree.
@@ -414,13 +417,16 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
fromName(name.toTermName.expandedName(owner)) orElse {
// (3) Try as a nested object symbol.
nestedObjectSymbol orElse {
- // // (4) Call the mirror's "missing" hook.
+ // (4) Call the mirror's "missing" hook.
adjust(ctx.base.missingHook(owner, name)) orElse {
// println(owner.info.decls.toList.map(_.debugString).mkString("\n ")) // !!! DEBUG
// }
// (5) Create a stub symbol to defer hard failure a little longer.
System.err.println(i"***** missing reference, looking for $name in $owner")
System.err.println(i"decls = ${owner.info.decls}")
+ owner.info.decls.checkConsistent()
+ if (slowSearch(name).exists)
+ System.err.println(i"**** slow search found: ${slowSearch(name)}")
new Exception().printStackTrace()
ctx.newStubSymbol(owner, name, source)
}