aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/itds/GenericMethodITD14.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/generics/itds/GenericMethodITD14.aj')
-rw-r--r--tests/java5/generics/itds/GenericMethodITD14.aj27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/GenericMethodITD14.aj b/tests/java5/generics/itds/GenericMethodITD14.aj
new file mode 100644
index 000000000..47b2aca37
--- /dev/null
+++ b/tests/java5/generics/itds/GenericMethodITD14.aj
@@ -0,0 +1,27 @@
+import java.util.*;
+
+class Base {
+}
+
+public class GenericMethodITD14 {
+
+ public static void main(String[] argv) {
+ List<A> as = new ArrayList<A>();
+ new Base().crazy(as); // bad. A implements Foo<C> but C is a
+ // subclass of A, not a superclass
+ }
+}
+
+interface Foo<T> {
+ public void m(T t);
+}
+
+class C extends A { }
+
+class A implements Foo<C> {
+ public void m(C a) {}
+}
+
+aspect X {
+ <R extends Foo<? super R>> void Base.crazy(List<R> lr) {}
+}