summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvican <jorgevc@fastmail.es>2016-12-20 08:30:30 +0100
committerjvican <jorgevc@fastmail.es>2017-03-24 19:12:00 +0100
commita436521f442e1f22f93db24f195570e7d34afdb2 (patch)
treea85b578fdcd6f8b1035e83dde26af159a187fdf4 /test
parent23e5ed9219b503c6a394b28d014ea5c29893db8d (diff)
downloadscala-a436521f442e1f22f93db24f195570e7d34afdb2.tar.gz
scala-a436521f442e1f22f93db24f195570e7d34afdb2.tar.bz2
scala-a436521f442e1f22f93db24f195570e7d34afdb2.zip
Improve stub error messages (SCP-009 proposal)
The following commit message is a squash of several commit messages. - This is the 1st commit message: Add position to stub error messages Stub errors happen when we've started the initialization of a symbol but key information of this symbol is missing (the information cannot be found in any entry of the classpath not sources). When this error happens, we better have a good error message with a position to the place where the stub error came from. This commit goes into this direction by adding a `pos` value to `StubSymbol` and filling it in in all the use sites (especifically `UnPickler`). This commit also changes some tests that test stub errors-related issues. Concretely, `t6440` is using special Partest infrastructure and doens't pretty print the position, while `t5148` which uses the conventional infrastructure does. Hence the difference in the changes for both tests. - This is the commit message #2: Add partest infrastructure to test stub errors `StubErrorMessageTest` is the friend I introduce in this commit to help state stub errors. The strategy to test them is easy and builds upon previous concepts: we reuse `StoreReporterDirectTest` and add some methods that will compile the code and simulate a missing classpath entry by removing the class files from the class directory (the folder where Scalac compiles to). This first iteration allow us to programmatically check that stub errors are emitted under certain conditions. - This is the commit message #3: Improve contents of stub error message This commit does three things: * Keep track of completing symbol while unpickling First, it removes the previous `symbolOnCompletion` definition to be more restrictive/clear and use only positions, since only positions are used to report the error (the rest of the information comes from the context of the `UnPickler`). Second, it adds a new variable called `lazyCompletingSymbol` that is responsible for keeping a reference to the symbol that produces the stub error. This symbol will usually (always?) come from the classpath entries and therefore we don't have its position (that's why we keep track of `symbolOnCompletion` as well). This is the one that we have to explicitly use in the stub error message, the culprit so to speak. Aside from these two changes, this commit modifies the existing tests that are affected by the change in the error message, which is more precise now, and adds new tests for stub errors that happen in complex inner cases and in return type of `MethodType`. * Check that order of initialization is correct With the changes introduced previously to keep track of position of symbols coming from source files, we may ask ourselves: is this going to work always? What happens if two symbols the initialization of two symbols is intermingled and the stub error message gets the wrong position? This commit adds a test case and modifications to the test infrastructure to double check empirically that this does not happen. Usually, this interaction in symbol initialization won't happen because the `UnPickler` will lazily load all the buckets necessary for a symbol to be truly initialized, with the pertinent addresses from which this information has to be deserialized. This ensures that this operation is atomic and no other symbol initialization can happen in the meantime. Even though the previous paragraph is the feeling I got from reading the sources, this commit creates a test to double-check it. My attempt to be better safe than sorry. * Improve contents of the stub error message This commit modifies the format of the previous stub error message by being more precise in its formulation. It follows the structured format: ``` s"""|Symbol '${name.nameKind} ${owner.fullName}.$name' is missing from the classpath. |This symbol is required by '${lazyCompletingSymbol.kindString} ${lazyCompletingSymbol.fullName}'. ``` This format has the advantage that is more readable and explicit on what's happening. First, we report what is missing. Then, why it was required. Hopefully, people working on direct dependencies will find the new message friendlier. Having a good test suite to check the previously added code is important. This commit checks that stub errors happen in presence of well-known and widely used Scala features. These include: * Higher kinded types. * Type definitions. * Inheritance and subclasses. * Typeclasses and implicits. - This is the commit message #4: Use `lastTreeToTyper` to get better positions The previous strategy to get the last user-defined position for knowing what was the root cause (the trigger) of stub errors relied on instrumenting `def info`. This instrumentation, while easy to implement, is inefficient since we register the positions for symbols that are already completed. However, we cannot do it only for uncompleted symbols (!hasCompleteInfo) because the positions won't be correct anymore -- definitions using stub symbols (val b = new B) are for the compiler completed, but their use throws stub errors. This means that if we initialize symbols between a definition and its use, we'll use their positions instead of the position of `b`. To work around this we use `lastTreeToTyper`. We assume that stub errors will be thrown by Typer at soonest. The benefit of this approach is better error messages. The positions used in them are now as concrete as possible since they point to the exact tree that **uses** a symbol, instead of the one that **defines** it. Have a look at `StubErrorComplexInnerClass` for an example. This commit removes the previous infrastructure and replaces it by the new one. It also removes the fields positions from the subclasses of `StubSymbol`s. - This is the commit message #5: Keep track of completing symbols Make sure that cycles don't happen by keeping track of all the symbols that are being completed by `completeInternal`. Stub errors only need the last completing symbols, but the whole stack of symbols may be useful to reporting other error like cyclic initialization issues. I've added this per Jason's suggestion. I've implemented with a list because `remove` in an array buffer is linear. Array was not an option because I would need to resize it myself. I think that even though list is not as efficient memory-wise, it probably doesn't matter since the stack will usually be small. - This is the commit message #6: Remove `isPackage` from `newStubSymbol` Remove `isPackage` since in 2.12.x its value is not used.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5148.check27
-rw-r--r--test/files/run/StubErrorBInheritsFromA.check6
-rw-r--r--test/files/run/StubErrorBInheritsFromA.scala22
-rw-r--r--test/files/run/StubErrorComplexInnerClass.check6
-rw-r--r--test/files/run/StubErrorComplexInnerClass.scala42
-rw-r--r--test/files/run/StubErrorHK.check6
-rw-r--r--test/files/run/StubErrorHK.scala22
-rw-r--r--test/files/run/StubErrorReturnTypeFunction.check6
-rw-r--r--test/files/run/StubErrorReturnTypeFunction.scala37
-rw-r--r--test/files/run/StubErrorReturnTypeFunction2.check6
-rw-r--r--test/files/run/StubErrorReturnTypeFunction2.scala37
-rw-r--r--test/files/run/StubErrorReturnTypePolyFunction.check15
-rw-r--r--test/files/run/StubErrorReturnTypePolyFunction.scala37
-rw-r--r--test/files/run/StubErrorSubclasses.check6
-rw-r--r--test/files/run/StubErrorSubclasses.scala21
-rw-r--r--test/files/run/StubErrorTypeDef.check16
-rw-r--r--test/files/run/StubErrorTypeDef.scala26
-rw-r--r--test/files/run/StubErrorTypeclass.check6
-rw-r--r--test/files/run/StubErrorTypeclass.scala21
-rw-r--r--test/files/run/t6440b.check11
-rw-r--r--test/files/run/t6440b.scala6
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_lookup.scala2
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.scala2
23 files changed, 363 insertions, 23 deletions
diff --git a/test/files/neg/t5148.check b/test/files/neg/t5148.check
index 1f58c235ce..8c895d7b47 100644
--- a/test/files/neg/t5148.check
+++ b/test/files/neg/t5148.check
@@ -1,16 +1,13 @@
-error: missing or invalid dependency detected while loading class file 'Imports.class'.
-Could not access term memberHandlers 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.)
+t5148.scala:4: error: Symbol 'term scala.tools.nsc.interpreter.IMain.memberHandlers' is missing from the classpath.
+This symbol is required by 'method scala.tools.nsc.interpreter.Imports.allReqAndHandlers'.
+Make sure that term memberHandlers is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'Imports.class' was compiled against an incompatible version of scala.tools.nsc.interpreter.IMain.
-error: missing or invalid dependency detected while loading class file 'Imports.class'.
-Could not access type Wrapper in class scala.tools.nsc.interpreter.IMain.Request,
-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.Request.
-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.
-three errors found
+class IMain extends Imports
+ ^
+t5148.scala:4: error: Symbol 'type <none>.Request.Wrapper' is missing from the classpath.
+This symbol is required by 'value scala.tools.nsc.interpreter.Imports.wrapper'.
+Make sure that type Wrapper is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'Imports.class' was compiled against an incompatible version of <none>.Request.
+class IMain extends Imports
+ ^
+two errors found
diff --git a/test/files/run/StubErrorBInheritsFromA.check b/test/files/run/StubErrorBInheritsFromA.check
new file mode 100644
index 0000000000..009f0887d4
--- /dev/null
+++ b/test/files/run/StubErrorBInheritsFromA.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:4: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'class stuberrors.B'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ new B
+ ^
diff --git a/test/files/run/StubErrorBInheritsFromA.scala b/test/files/run/StubErrorBInheritsFromA.scala
new file mode 100644
index 0000000000..3e02692171
--- /dev/null
+++ b/test/files/run/StubErrorBInheritsFromA.scala
@@ -0,0 +1,22 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ """
+
+ def codeB = """
+ package stuberrors
+ class B extends A
+ """
+
+ def userCode = """
+ package stuberrors
+ class C {
+ new B
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorComplexInnerClass.check b/test/files/run/StubErrorComplexInnerClass.check
new file mode 100644
index 0000000000..fe089de8ad
--- /dev/null
+++ b/test/files/run/StubErrorComplexInnerClass.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:9: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'class stuberrors.B.BB'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ new b.BB
+ ^
diff --git a/test/files/run/StubErrorComplexInnerClass.scala b/test/files/run/StubErrorComplexInnerClass.scala
new file mode 100644
index 0000000000..2028644601
--- /dev/null
+++ b/test/files/run/StubErrorComplexInnerClass.scala
@@ -0,0 +1,42 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ """
+
+ def codeB = """
+ package stuberrors
+ class B {
+ def foo: String = ???
+
+ // unused and should fail, but not loaded
+ def unsafeFoo: A = ???
+ // used, B.info -> BB.info -> unpickling A -> stub error
+ class BB extends A
+ }
+ """
+
+ def userCode = """
+ package stuberrors
+ class C {
+ def aloha = {
+ val b = new B
+ val d = new extra.D
+ d.foo
+ println(b.foo)
+ new b.BB
+ }
+ }
+ """
+
+ override def extraUserCode = """
+ package extra
+ class D {
+ def foo = "Hello, World"
+ }
+ """.stripMargin
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorHK.check b/test/files/run/StubErrorHK.check
new file mode 100644
index 0000000000..6f37f8ea41
--- /dev/null
+++ b/test/files/run/StubErrorHK.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:4: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'type stuberrors.B.D'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ println(new B)
+ ^
diff --git a/test/files/run/StubErrorHK.scala b/test/files/run/StubErrorHK.scala
new file mode 100644
index 0000000000..7ee8c6d6a5
--- /dev/null
+++ b/test/files/run/StubErrorHK.scala
@@ -0,0 +1,22 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ """
+
+ def codeB = """
+ package stuberrors
+ class B[D <: A]
+ """
+
+ def userCode = """
+ package stuberrors
+ object C extends App {
+ println(new B)
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorReturnTypeFunction.check b/test/files/run/StubErrorReturnTypeFunction.check
new file mode 100644
index 0000000000..bd61d5f5fa
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypeFunction.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:13: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'method stuberrors.B.foo'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ b.foo
+ ^
diff --git a/test/files/run/StubErrorReturnTypeFunction.scala b/test/files/run/StubErrorReturnTypeFunction.scala
new file mode 100644
index 0000000000..75a02cff63
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypeFunction.scala
@@ -0,0 +1,37 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ class AA
+ """
+
+ def codeB = """
+ package stuberrors
+
+ abstract class B {
+ def bar: String = ???
+ def foo: A = new A
+ def baz: String = ???
+ }
+ """
+
+ def userCode = """
+ package stuberrors
+
+ abstract class C extends App {
+ val b = new B {}
+
+ // Use other symbols in the meanwhile
+ val aa = new AA
+ val dummy = 1
+ println(dummy)
+
+ // Should blow up
+ b.foo
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorReturnTypeFunction2.check b/test/files/run/StubErrorReturnTypeFunction2.check
new file mode 100644
index 0000000000..bd61d5f5fa
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypeFunction2.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:13: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'method stuberrors.B.foo'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ b.foo
+ ^
diff --git a/test/files/run/StubErrorReturnTypeFunction2.scala b/test/files/run/StubErrorReturnTypeFunction2.scala
new file mode 100644
index 0000000000..efb2f4f190
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypeFunction2.scala
@@ -0,0 +1,37 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ class AA
+ """
+
+ def codeB = """
+ package stuberrors
+
+ class B {
+ def bar: String = ???
+ def foo: A = new A
+ def baz: String = ???
+ }
+ """
+
+ def userCode = """
+ package stuberrors
+
+ abstract class C extends App {
+ val b = new B {}
+
+ // Use other symbols in the meanwhile
+ val aa = new AA
+ val dummy = 1
+ println(dummy)
+
+ // Should blow up
+ b.foo
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorReturnTypePolyFunction.check b/test/files/run/StubErrorReturnTypePolyFunction.check
new file mode 100644
index 0000000000..78e309668e
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypePolyFunction.check
@@ -0,0 +1,15 @@
+error: newSource1.scala:13: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'class stuberrors.D'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'D.class' was compiled against an incompatible version of stuberrors.
+ b.foo[D]
+ ^
+error: newSource1.scala:13: type arguments [stuberrors.D] do not conform to method foo's type parameter bounds [T <: stuberrors.A]
+ b.foo[D]
+ ^
+error: newSource1.scala:13: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'type stuberrors.B.T'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ b.foo[D]
+ ^
diff --git a/test/files/run/StubErrorReturnTypePolyFunction.scala b/test/files/run/StubErrorReturnTypePolyFunction.scala
new file mode 100644
index 0000000000..8345aaade0
--- /dev/null
+++ b/test/files/run/StubErrorReturnTypePolyFunction.scala
@@ -0,0 +1,37 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ class AA
+ """
+
+ def codeB = """
+ package stuberrors
+
+ class B {
+ def foo[T <: A]: T = ???
+ }
+
+ class D extends A
+ """
+
+ def userCode = """
+ package stuberrors
+
+ abstract class C extends App {
+ val b = new B
+
+ // Use other symbols in the meanwhile
+ val aa = new AA
+ val dummy = 1
+ println(dummy)
+
+ // Should blow up
+ b.foo[D]
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorSubclasses.check b/test/files/run/StubErrorSubclasses.check
new file mode 100644
index 0000000000..8ccd781cad
--- /dev/null
+++ b/test/files/run/StubErrorSubclasses.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:3: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'class stuberrors.B'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ class C extends B
+ ^
diff --git a/test/files/run/StubErrorSubclasses.scala b/test/files/run/StubErrorSubclasses.scala
new file mode 100644
index 0000000000..b19155e20e
--- /dev/null
+++ b/test/files/run/StubErrorSubclasses.scala
@@ -0,0 +1,21 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ """
+
+ def codeB = """
+ package stuberrors
+ class B extends A
+ """
+
+ def userCode = """
+ package stuberrors
+ class C extends B
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
+
diff --git a/test/files/run/StubErrorTypeDef.check b/test/files/run/StubErrorTypeDef.check
new file mode 100644
index 0000000000..955d9b0880
--- /dev/null
+++ b/test/files/run/StubErrorTypeDef.check
@@ -0,0 +1,16 @@
+error: newSource1.scala:4: overriding type D in class B with bounds <: stuberrors.A;
+ type D has incompatible type
+ new B { type D = E }
+ ^
+error: newSource1.scala:4: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'type stuberrors.B.D'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ new B { type D = E }
+ ^
+error: newSource1.scala:4: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'class stuberrors.E'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'E.class' was compiled against an incompatible version of stuberrors.
+ new B { type D = E }
+ ^
diff --git a/test/files/run/StubErrorTypeDef.scala b/test/files/run/StubErrorTypeDef.scala
new file mode 100644
index 0000000000..967964d815
--- /dev/null
+++ b/test/files/run/StubErrorTypeDef.scala
@@ -0,0 +1,26 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A
+ class NestedB[T]
+ """
+
+ def codeB = """
+ package stuberrors
+ class E extends A
+ abstract class B {
+ type D <: A
+ }
+ """
+
+ def userCode = """
+ package stuberrors
+ class C {
+ new B { type D = E }
+ }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/StubErrorTypeclass.check b/test/files/run/StubErrorTypeclass.check
new file mode 100644
index 0000000000..7ecee64ec9
--- /dev/null
+++ b/test/files/run/StubErrorTypeclass.check
@@ -0,0 +1,6 @@
+error: newSource1.scala:4: Symbol 'type stuberrors.A' is missing from the classpath.
+This symbol is required by 'value stuberrors.B.evidence$1'.
+Make sure that type A is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'B.class' was compiled against an incompatible version of stuberrors.
+ class C { println(new B(1)) }
+ ^
diff --git a/test/files/run/StubErrorTypeclass.scala b/test/files/run/StubErrorTypeclass.scala
new file mode 100644
index 0000000000..e9a48d5430
--- /dev/null
+++ b/test/files/run/StubErrorTypeclass.scala
@@ -0,0 +1,21 @@
+object Test extends scala.tools.partest.StubErrorMessageTest {
+ def codeA = """
+ package stuberrors
+ class A[T]
+ """
+
+ def codeB = """
+ package stuberrors
+ class B[T: A](val t: T)
+ """
+
+ def userCode = """
+ package stuberrors
+ // Here we want a stub error not an implicit not found error
+ class C { println(new B(1)) }
+ """
+
+ def removeFromClasspath(): Unit = {
+ removeClasses("stuberrors", List("A"))
+ }
+}
diff --git a/test/files/run/t6440b.check b/test/files/run/t6440b.check
index a6100d6d1e..07ec4f2a19 100644
--- a/test/files/run/t6440b.check
+++ b/test/files/run/t6440b.check
@@ -1,5 +1,6 @@
-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
+error: newSource1.scala:4: Symbol 'type pack1.T' is missing from the classpath.
+This symbol is required by 'method pack1.U.t'.
+Make sure that type T is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
+A full rebuild may help if 'U.class' was compiled against an incompatible version of pack1.
+ pack2.V.u.t // we have to fail if T.class is missing
+ ^
diff --git a/test/files/run/t6440b.scala b/test/files/run/t6440b.scala
index 7ab9529ccb..a1ad717162 100644
--- a/test/files/run/t6440b.scala
+++ b/test/files/run/t6440b.scala
@@ -56,6 +56,10 @@ object Test extends StoreReporterDirectTest {
// bad symbolic reference error expected (but no stack trace!)
compileCode(app2)
- println(filteredInfos.mkString("\n"))
+ import scala.reflect.internal.util.Position
+ filteredInfos.map { report =>
+ print(if (report.severity == storeReporter.ERROR) "error: " else "")
+ println(Position.formatMessage(report.pos, report.msg, true))
+ }
}
}
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 3d2b9f77be..dccb2af8f5 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala
+++ b/test/files/run/typetags_without_scala_reflect_typetag_lookup.scala
@@ -38,6 +38,6 @@ object Test extends StoreReporterDirectTest {
compileApp();
// 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("missing or invalid dependency detected")).mkString("\n"))
+ println(filteredInfos.filterNot(_.msg.contains("is missing from the classpath")).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 a865f4d137..c865759588 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
@@ -42,6 +42,6 @@ object Test extends StoreReporterDirectTest {
compileApp();
// 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("missing or invalid dependency detected")).mkString("\n"))
+ println(filteredInfos.filterNot (_.msg.contains("is missing from the classpath")).mkString("\n"))
}
}