summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/neg/t750.check15
-rw-r--r--test/files/neg/t750/AO_1.java5
-rw-r--r--test/files/neg/t750/Test_2.scala6
-rw-r--r--test/files/neg/t750b.check15
-rw-r--r--test/files/neg/t750b/AO.java5
-rw-r--r--test/files/neg/t750b/Test.scala6
6 files changed, 52 insertions, 0 deletions
diff --git a/test/files/neg/t750.check b/test/files/neg/t750.check
new file mode 100644
index 0000000000..c17ca334e6
--- /dev/null
+++ b/test/files/neg/t750.check
@@ -0,0 +1,15 @@
+Test_2.scala:4: error: type mismatch;
+ found : Array[Int]
+ required: Array[? with Object]
+Note: Int >: ? with Object, but class Array is invariant in type T.
+You may wish to investigate a wildcard type such as `_ >: ? with Object`. (SLS 3.2.10)
+ AO_1.f(a)
+ ^
+Test_2.scala:5: error: type mismatch;
+ found : Array[Int]
+ required: Array[Int]
+Note: Int >: Int, but class Array is invariant in type T.
+You may wish to investigate a wildcard type such as `_ >: Int`. (SLS 3.2.10)
+ AO_1.f[Int](a)
+ ^
+two errors found
diff --git a/test/files/neg/t750/AO_1.java b/test/files/neg/t750/AO_1.java
new file mode 100644
index 0000000000..4c7360ec6f
--- /dev/null
+++ b/test/files/neg/t750/AO_1.java
@@ -0,0 +1,5 @@
+public class AO_1 {
+ public static <T> void f(T[] ar0) {
+ System.out.println(ar0);
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t750/Test_2.scala b/test/files/neg/t750/Test_2.scala
new file mode 100644
index 0000000000..80977431c5
--- /dev/null
+++ b/test/files/neg/t750/Test_2.scala
@@ -0,0 +1,6 @@
+// t750
+object Test extends App {
+ val a = Array(1, 2, 3)
+ AO_1.f(a)
+ AO_1.f[Int](a)
+}
diff --git a/test/files/neg/t750b.check b/test/files/neg/t750b.check
new file mode 100644
index 0000000000..72a249191e
--- /dev/null
+++ b/test/files/neg/t750b.check
@@ -0,0 +1,15 @@
+Test.scala:4: error: type mismatch;
+ found : Array[Int]
+ required: Array[? with Object]
+Note: Int >: ? with Object, but class Array is invariant in type T.
+You may wish to investigate a wildcard type such as `_ >: ? with Object`. (SLS 3.2.10)
+ AO.f(a)
+ ^
+Test.scala:5: error: type mismatch;
+ found : Array[Int]
+ required: Array[Int]
+Note: Int >: Int, but class Array is invariant in type T.
+You may wish to investigate a wildcard type such as `_ >: Int`. (SLS 3.2.10)
+ AO.f[Int](a)
+ ^
+two errors found
diff --git a/test/files/neg/t750b/AO.java b/test/files/neg/t750b/AO.java
new file mode 100644
index 0000000000..060baf9a3c
--- /dev/null
+++ b/test/files/neg/t750b/AO.java
@@ -0,0 +1,5 @@
+public class AO {
+ public static <T> void f(T[] ar0) {
+ System.out.println(ar0);
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t750b/Test.scala b/test/files/neg/t750b/Test.scala
new file mode 100644
index 0000000000..5f792a7be8
--- /dev/null
+++ b/test/files/neg/t750b/Test.scala
@@ -0,0 +1,6 @@
+// t750
+object Test extends App {
+ val a = Array(1, 2, 3)
+ AO.f(a)
+ AO.f[Int](a)
+}