summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-07-25 17:53:44 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-07-25 17:53:44 +0200
commit4445615029488503f266f6a83d4ea909087118c3 (patch)
tree8d2811e691c15c23ef2a960b8531b7240f2d6d04
parent5a878c2ed86e940bfff4b95b52b356a2c1146bb4 (diff)
parentc4360481251fdec0599598c24da400a8bace3247 (diff)
downloadscala-4445615029488503f266f6a83d4ea909087118c3.tar.gz
scala-4445615029488503f266f6a83d4ea909087118c3.tar.bz2
scala-4445615029488503f266f6a83d4ea909087118c3.zip
Merge pull request #3894 from adriaanm/depmsg
Better error message than 'bad symbolic reference'.
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala11
-rw-r--r--test/files/neg/t5148.check9
-rw-r--r--test/files/run/t6440.check9
-rw-r--r--test/files/run/t6440b.check9
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_lookup.scala4
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala4
6 files changed, 25 insertions, 21 deletions
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index b808666360..8d4c3f752f 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -254,12 +254,13 @@ abstract class UnPickler {
// (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 fullName = s"${owner.fullName}.$name"
+ val advice = moduleAdvice(s"${owner.fullName}.$name")
val missingMessage =
- s"""|bad symbolic reference to $fullName encountered in class file '$filename'.
- |Cannot access ${name.longString} in ${owner.kindString} ${owner.fullName}. The current classpath may be
- |missing a definition for $fullName, or $filename may have been compiled against a version that's
- |incompatible with the one found on the current classpath.${moduleAdvice(fullName)}""".stripMargin
+ 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)
}
}
diff --git a/test/files/neg/t5148.check b/test/files/neg/t5148.check
index 8a667f4b88..0de4fe2d4c 100644
--- a/test/files/neg/t5148.check
+++ b/test/files/neg/t5148.check
@@ -1,5 +1,6 @@
-error: bad symbolic reference to scala.tools.nsc.interpreter.IMain.Request encountered in class file 'Imports.class'.
-Cannot access type Request in class scala.tools.nsc.interpreter.IMain. The current classpath may be
-missing a definition for scala.tools.nsc.interpreter.IMain.Request, or Imports.class may have been compiled against a version that's
-incompatible with the one found on the current classpath.
+error: missing or invalid dependency detected while loading class file 'Imports.class'.
+Could not access type Request in class scala.tools.nsc.interpreter.IMain,
+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 'Imports.class' was compiled against an incompatible version of scala.tools.nsc.interpreter.IMain.
one error found
diff --git a/test/files/run/t6440.check b/test/files/run/t6440.check
index 27d5d1380e..2358f08fcc 100644
--- a/test/files/run/t6440.check
+++ b/test/files/run/t6440.check
@@ -1,4 +1,5 @@
-pos: source-newSource1.scala,line-9,offset=109 bad symbolic reference to <root>.pack1 encountered in class file 'U.class'.
-Cannot access term pack1 in package <root>. The current classpath may be
-missing a definition for <root>.pack1, or U.class may have been compiled against a version that's
-incompatible with the one found on the current classpath. ERROR
+pos: source-newSource1.scala,line-9,offset=109 missing or invalid dependency detected while loading class file 'U.class'.
+Could not access term pack1 in package <root>,
+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 'U.class' was compiled against an incompatible version of <root>. ERROR
diff --git a/test/files/run/t6440b.check b/test/files/run/t6440b.check
index 0b642c2c35..a6100d6d1e 100644
--- a/test/files/run/t6440b.check
+++ b/test/files/run/t6440b.check
@@ -1,4 +1,5 @@
-pos: NoPosition bad symbolic reference to pack1.T encountered in class file 'U.class'.
-Cannot access type T in package pack1. The current classpath may be
-missing a definition for pack1.T, or U.class may have been compiled against a version that's
-incompatible with the one found on the current classpath. ERROR
+pos: NoPosition missing or invalid dependency detected while loading class file 'U.class'.
+Could not access type T in package pack1,
+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 'U.class' was compiled against an incompatible version of pack1. ERROR
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala b/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala
index 1fbdc62a1e..3d2b9f77be 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala
+++ b/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala
@@ -36,8 +36,8 @@ object Test extends StoreReporterDirectTest {
println(filteredInfos.mkString("\n"))
storeReporter.infos.clear()
compileApp();
- // we should get bad symbolic reference errors, because we're trying to use an implicit that can't be unpickled
+ // we should get "missing or invalid dependency detected" errors, because we're trying to use an implicit that can't be unpickled
// but we don't know the number of these errors and their order, so I just ignore them all
- println(filteredInfos.filterNot(_.msg.contains("bad symbolic reference")).mkString("\n"))
+ println(filteredInfos.filterNot(_.msg.contains("missing or invalid dependency detected")).mkString("\n"))
}
}
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
index 6804baa0c3..a865f4d137 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
+++ b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
@@ -40,8 +40,8 @@ object Test extends StoreReporterDirectTest {
println(filteredInfos.mkString("\n"))
storeReporter.infos.clear()
compileApp();
- // we should get bad symbolic reference errors, because we're trying to use an implicit that can't be unpickled
+ // we should get "missing or invalid dependency detected" errors, because we're trying to use an implicit that can't be unpickled
// but we don't know the number of these errors and their order, so I just ignore them all
- println(filteredInfos.filterNot (_.msg.contains("bad symbolic reference")).mkString("\n"))
+ println(filteredInfos.filterNot (_.msg.contains("missing or invalid dependency detected")).mkString("\n"))
}
}