aboutsummaryrefslogtreecommitdiff
path: root/tests/pos-java-interop/t2413
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-10-28 22:52:16 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-11-22 01:35:06 +0100
commit0dc738dd1377577a4004bfe158b11bfb1fa59a9d (patch)
tree0756502d63341e2503254ca19f37693271c31220 /tests/pos-java-interop/t2413
parent02a29c9f2127ea7b0cb0b05facd3afe8e2ec256a (diff)
downloaddotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.tar.gz
dotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.tar.bz2
dotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.zip
Fix partest compilation of java-interop tests by moving them
Previously, the tests where all in tests/pos/java-interop which means that partest would try to run them as one single test, this failed because some of these tests define classes with the same name. We could fix this by putting them all in separate packages but for now it's simple to move them to tests/pos-java-interop (they will still be run individually as they should thanks to the `java_all` test defined in tests.scala)
Diffstat (limited to 'tests/pos-java-interop/t2413')
-rw-r--r--tests/pos-java-interop/t2413/TestJava.java7
-rw-r--r--tests/pos-java-interop/t2413/TestScalac.scala23
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pos-java-interop/t2413/TestJava.java b/tests/pos-java-interop/t2413/TestJava.java
new file mode 100644
index 000000000..252c01fbc
--- /dev/null
+++ b/tests/pos-java-interop/t2413/TestJava.java
@@ -0,0 +1,7 @@
+package pack;
+
+public class TestJava {
+ protected String repeatParam(String ... items) {
+ return "nothing";
+ }
+}
diff --git a/tests/pos-java-interop/t2413/TestScalac.scala b/tests/pos-java-interop/t2413/TestScalac.scala
new file mode 100644
index 000000000..098e852dd
--- /dev/null
+++ b/tests/pos-java-interop/t2413/TestScalac.scala
@@ -0,0 +1,23 @@
+import pack.TestJava
+
+class Foo extends TestJava {
+
+ // THIS METHOD YIELDS TO CRASH
+/* def foomethod : Option[String] => Unit = {
+ case None =>
+ val path = repeatParam("s","a","b","c")
+ ()
+ case Some(error) =>
+ ()
+ }
+
+ // THIS IS OK
+ def foomethod2 : String = repeatParam("s","a");
+
+ // THIS IS OK
+ val aVal = repeatParam("1","2","3") */
+
+ // THIS YIELDS TO CRASH
+ for (a <- 1 to 4 ; anotherVal = repeatParam("1","2","3"))
+ yield anotherVal
+}