summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect/scala/reflect/internal/pickling/UnPickler.scala')
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala43
1 files changed, 13 insertions, 30 deletions
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index 6dea184826..fe1de91662 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -216,19 +216,6 @@ abstract class UnPickler {
}
adjust(decl)
}
- 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.
- // the "case Apply" in readTree() takes care of selecting the correct alternative
- // after parsing the arguments.
- if (owner.isOverloaded)
- return NoSymbol
-
- if (tag == EXTMODCLASSref) {
- owner.info.decl(nme.moduleVarName(name.toTermName))
- }
- NoSymbol
- }
def moduleAdvice(missing: String): String = {
val module =
@@ -255,20 +242,18 @@ abstract class UnPickler {
// symbols are read from outside: for instance when checking the children
// of a class. See #1722.
fromName(nme.expandedName(name.toTermName, owner)) orElse {
- // (3) Try as a nested object symbol.
- nestedObjectSymbol orElse {
- // (4) Call the mirror's "missing" hook.
- adjust(mirrorThatLoaded(owner).missingHook(owner, name)) orElse {
- // (5) Create a stub symbol to defer hard failure a little longer.
- val advice = moduleAdvice(s"${owner.fullName}.$name")
- val missingMessage =
- s"""|missing or invalid dependency detected while loading class file '$filename'.
- |Could not access ${name.longString} in ${owner.kindString} ${owner.fullName},
- |because it (or its dependencies) are missing. Check your build definition for
- |missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
- |A full rebuild may help if '$filename' was compiled against an incompatible version of ${owner.fullName}.$advice""".stripMargin
- owner.newStubSymbol(name, missingMessage)
- }
+ // (3) Call the mirror's "missing" hook.
+ adjust(mirrorThatLoaded(owner).missingHook(owner, name)) orElse {
+ // (4) Create a stub symbol to defer hard failure a little longer.
+ val advice = moduleAdvice(s"${owner.fullName}.$name")
+ val missingMessage =
+ s"""|missing or invalid dependency detected while loading class file '$filename'.
+ |Could not access ${name.longString} in ${owner.kindString} ${owner.fullName},
+ |because it (or its dependencies) are missing. Check your build definition for
+ |missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
+ |A full rebuild may help if '$filename' was compiled against an incompatible version of ${owner.fullName}.$advice""".stripMargin
+ val stubName = if (tag == EXTref) name else name.toTypeName
+ owner.newStubSymbol(stubName, missingMessage)
}
}
}
@@ -392,9 +377,7 @@ abstract class UnPickler {
def readThisType(): Type = {
val sym = readSymbolRef() match {
- case stub: StubSymbol if !stub.isClass =>
- // SI-8502 This allows us to create a stub for a unpickled reference to `missingPackage.Foo`.
- stub.owner.newStubSymbol(stub.name.toTypeName, stub.missingMessage, isPackage = true)
+ case stub: StubSymbol => stub.setFlag(PACKAGE)
case sym => sym
}
ThisType(sym)