summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-03 07:39:34 +0000
committeraclement <aclement>2005-08-03 07:39:34 +0000
commitfbb19cca208211667f34316a0d8e15cae60987dc (patch)
treec3d4e8c111a22c8bfd845ff689959c39a5a16059 /tests
parent9566ac2e6de5f1edc91425cd47966b137b41a4ee (diff)
downloadaspectj-fbb19cca208211667f34316a0d8e15cae60987dc.tar.gz
aspectj-fbb19cca208211667f34316a0d8e15cae60987dc.zip
genericitds: more combinations
Diffstat (limited to 'tests')
-rw-r--r--tests/java5/generics/itds/GenericMethodITD10.aj19
-rw-r--r--tests/java5/generics/itds/GenericMethodITD7.aj20
-rw-r--r--tests/java5/generics/itds/GenericMethodITD8.aj20
-rw-r--r--tests/java5/generics/itds/GenericMethodITD9.aj22
4 files changed, 81 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/GenericMethodITD10.aj b/tests/java5/generics/itds/GenericMethodITD10.aj
new file mode 100644
index 000000000..1e38a1594
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD10.aj
@@ -0,0 +1,19 @@
+import java.util.*;
+
+class Base {
+}
+
+public class GenericMethodITD10 {
+
+ public static void main(String[] argv) {
+ List<A> as = new ArrayList<A>();
+ new Base().crazy(as); // A is not Comparable
+ }
+}
+
+class A {
+}
+
+aspect X {
+ <R extends Comparable<? super R>> void Base.crazy(List<R> lr) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD7.aj b/tests/java5/generics/itds/GenericMethodITD7.aj
new file mode 100644
index 000000000..923f71692
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD7.aj
@@ -0,0 +1,20 @@
+import java.util.*;
+
+class Base { }
+
+public class GenericMethodITD7 {
+
+ public static void main(String[] argv) {
+ List<Number> ns = new ArrayList<Number>();
+ List<Double> ds = new ArrayList<Double>();
+ new Base().simple(ns,ds); // ok, List<Number> and List<Double>
+ }
+}
+
+class Super {}
+
+class A extends Super {}
+
+aspect X {
+ <E> void Base.simple(List<E> lista,List<? extends E> listb) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD8.aj b/tests/java5/generics/itds/GenericMethodITD8.aj
new file mode 100644
index 000000000..8f8f5fc44
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD8.aj
@@ -0,0 +1,20 @@
+import java.util.*;
+
+class Base { }
+
+public class GenericMethodITD8 {
+
+ public static void main(String[] argv) {
+ List<Number> ns = new ArrayList<Number>();
+ List<String> ss = new ArrayList<String>();
+ new Base().simple(ns,ss); // error, ss doesn't fit List<? extends E>
+ }
+}
+
+class Super {}
+
+class A extends Super {}
+
+aspect X {
+ <E> void Base.simple(List<E> list1,List<? extends E> list2) {}
+}
diff --git a/tests/java5/generics/itds/GenericMethodITD9.aj b/tests/java5/generics/itds/GenericMethodITD9.aj
new file mode 100644
index 000000000..d7f20909b
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD9.aj
@@ -0,0 +1,22 @@
+import java.util.*;
+
+class Base {
+}
+
+public class GenericMethodITD9 {
+
+ public static void main(String[] argv) {
+ List<A> as = new ArrayList<A>();
+ new Base().crazy(as); // ok !
+ }
+}
+
+class A implements Comparable<A> {
+ public int compareTo(A anotherA) {
+ return 0;
+ }
+}
+
+aspect X {
+ public <R extends Comparable<? super R>> void Base.crazy(List<R> lr) {}
+}