summaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/itds/GenericMethodITD14.aj
blob: 47b2aca378f1bb9669828c8653fa475ae4d3a899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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) {}
}