diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-12-07 09:45:58 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-12-07 09:45:58 -0800 |
commit | 4d439dd4b2bb9e2364fc494af9f3ae4686ff9f65 (patch) | |
tree | 31aadf6c4564643bb514e609f6752130aab6e1b0 /test | |
parent | a774157a4b666f29b7cd4bd958ea1ac150380959 (diff) | |
parent | 8d74fa024262c1bd2dc7ed64788b95f888396c05 (diff) | |
download | scala-4d439dd4b2bb9e2364fc494af9f3ae4686ff9f65.tar.gz scala-4d439dd4b2bb9e2364fc494af9f3ae4686ff9f65.tar.bz2 scala-4d439dd4b2bb9e2364fc494af9f3ae4686ff9f65.zip |
Merge pull request #3230 from retronym/backport/7439
[backport] SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t7439.check | 1 | ||||
-rw-r--r-- | test/files/run/t7439/A_1.java | 3 | ||||
-rw-r--r-- | test/files/run/t7439/B_1.java | 3 | ||||
-rw-r--r-- | test/files/run/t7439/Test_2.scala | 31 |
4 files changed, 38 insertions, 0 deletions
diff --git a/test/files/run/t7439.check b/test/files/run/t7439.check new file mode 100644 index 0000000000..ce9e8b52ff --- /dev/null +++ b/test/files/run/t7439.check @@ -0,0 +1 @@ +pos: NoPosition Class A_1 not found - continuing with a stub. WARNING diff --git a/test/files/run/t7439/A_1.java b/test/files/run/t7439/A_1.java new file mode 100644 index 0000000000..4accd95d57 --- /dev/null +++ b/test/files/run/t7439/A_1.java @@ -0,0 +1,3 @@ +public class A_1 { + +}
\ No newline at end of file diff --git a/test/files/run/t7439/B_1.java b/test/files/run/t7439/B_1.java new file mode 100644 index 0000000000..5dd3b93d6f --- /dev/null +++ b/test/files/run/t7439/B_1.java @@ -0,0 +1,3 @@ +public class B_1 { + public void b(A_1[] a) {} +} diff --git a/test/files/run/t7439/Test_2.scala b/test/files/run/t7439/Test_2.scala new file mode 100644 index 0000000000..e00e9d1b68 --- /dev/null +++ b/test/files/run/t7439/Test_2.scala @@ -0,0 +1,31 @@ +import scala.tools.partest._ +import java.io.File + +object Test extends StoreReporterDirectTest { + def code = ??? + + def compileCode(code: String) = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + } + + def C = """ + class C { + new B_1 + } + """ + + def show(): Unit = { + //compileCode(C) + assert(filteredInfos.isEmpty, filteredInfos) + + // blow away the entire package + val a1Class = new File(testOutput.path, "A_1.class") + assert(a1Class.exists) + assert(a1Class.delete()) + + // bad symbolic reference error expected (but no stack trace!) + compileCode(C) + println(storeReporter.infos.mkString("\n")) // Included a NullPointerException before. + } +} |