summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-23 14:50:44 -0700
committerPaul Phillips <paulp@improving.org>2013-06-23 14:50:44 -0700
commit693a36d7692628c5765276a2d7390aae75eed5e5 (patch)
treefe2b8ca64905a633a533a370d5ae130e72fdbae9 /test
parentb6bc53479984f9fc0528a8ce3f6f0b582cb4147f (diff)
parenta95432168204964e4f6c4571e781559c1640f2d8 (diff)
downloadscala-693a36d7692628c5765276a2d7390aae75eed5e5.tar.gz
scala-693a36d7692628c5765276a2d7390aae75eed5e5.tar.bz2
scala-693a36d7692628c5765276a2d7390aae75eed5e5.zip
Merge pull request #2637 from retronym/ticket/7439
SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols. …
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t7439.check2
-rw-r--r--test/files/run/t7439/A_1.java3
-rw-r--r--test/files/run/t7439/B_1.java3
-rw-r--r--test/files/run/t7439/Test_2.scala32
4 files changed, 40 insertions, 0 deletions
diff --git a/test/files/run/t7439.check b/test/files/run/t7439.check
new file mode 100644
index 0000000000..9ea09f9c40
--- /dev/null
+++ b/test/files/run/t7439.check
@@ -0,0 +1,2 @@
+Recompiling after deleting t7439-run.obj/A_1.class
+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..3ebbcfe753
--- /dev/null
+++ b/test/files/run/t7439/Test_2.scala
@@ -0,0 +1,32 @@
+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())
+ println(s"Recompiling after deleting $a1Class")
+
+ // bad symbolic reference error expected (but no stack trace!)
+ compileCode(C)
+ println(storeReporter.infos.mkString("\n")) // Included a NullPointerException before.
+ }
+}