blob: 94abd653f1c04497f01d438d58a84e3ce306e8d7 (
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
28
29
30
31
|
// lots of errors
import java.util.*;
abstract aspect GenericAspect<A,B> {
interface SimpleI<L> {}
declare parents: A implements SimpleI<B>;
public N SimpleI<N>.m0(N n) { System.err.println(n);return n;}
public List<N> SimpleI<N>.m1(List<N> ln) { System.err.println(ln);return ln;}
public N SimpleI<N>.f;
public List<N> SimpleI<N>.lf;
}
// We are making the decp put SimpleI<Integer> on Base - so all these string
// things below should fail!
aspect GenericAspectM extends GenericAspect<Base,Integer> {
public static void main(String []argv) {
Base b = new Base();
List<String> ls = new ArrayList<String>();
String s = b.m0("hello"); // error
List<String> ls2 = b.m1(ls);// error
b.f="hello";// error
b.lf=ls;// error
}
}
class Base {}
|