aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-04-03 18:55:28 +0200
committerMartin Odersky <odersky@gmail.com>2015-04-03 18:55:28 +0200
commitec7f7f525dfa335ef36b604bc3f1ccd2ec4679db (patch)
treee71e5d2b6df04a98485c48edf1186244a2d55270
parent62433d2877e3c3dd8a5385b2057274c7f36d6ff2 (diff)
downloaddotty-ec7f7f525dfa335ef36b604bc3f1ccd2ec4679db.tar.gz
dotty-ec7f7f525dfa335ef36b604bc3f1ccd2ec4679db.tar.bz2
dotty-ec7f7f525dfa335ef36b604bc3f1ccd2ec4679db.zip
Fixed test failure for core_pickling.
When reading external symbols from class Object, need to consider members of Any as well.
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala5
-rw-r--r--test/dotc/tests.scala2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index 462a8a370..a47b8bda2 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -368,7 +368,10 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
def fromName(name: Name): Symbol = name.toTermName match {
case nme.ROOT => loadingMirror.RootClass
case nme.ROOTPKG => loadingMirror.RootPackage
- case _ => adjust(owner.info.decl(name))
+ case _ =>
+ def declIn(owner: Symbol) = adjust(owner.info.decl(name))
+ val sym = declIn(owner)
+ if (sym.exists || owner.ne(defn.ObjectClass)) sym else declIn(defn.AnyClass)
}
def nestedObjectSymbol: Symbol = {
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala
index 9294389b1..3a55dfba2 100644
--- a/test/dotc/tests.scala
+++ b/test/dotc/tests.scala
@@ -135,7 +135,7 @@ class tests extends CompilerTest {
// class file 'target/scala-2.11/dotty_2.11-0.1-SNAPSHOT.jar(dotty/tools/dotc/core/ConstraintHandling$$anon$1.class)'
// has location not matching its contents: contains class $anon
- @Test def dotc_core_pickling = compileDir(dotcDir + "tools/dotc/core/pickling", failedOther)(allowDeepSubtypes)
+ @Test def dotc_core_pickling = compileDir(dotcDir + "tools/dotc/core/pickling")(allowDeepSubtypes)
// exception caught when loading class ClassfileParser$$anon$1: dotty.tools.dotc.core.Denotations$NotDefinedHere:
// demanding denotation of module class ClassfileParser$$anon$1$ at phase frontend(1) outside defined interval:
// defined periods are Period(31..36, run = 2) Period(3..24, run = 2) Period(25..26, run = 2)