blob: e2c318c0a80471e4613b0b066da41bfb3420c9d6 (
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
|
// Here A is modified to implemen SimpleI<String>
import java.util.*;
abstract aspect GenericAspect<A> {
interface SimpleI<X> {}
declare parents: A implements SimpleI<String>;
public N SimpleI<N>.m4(N n) { System.err.println(n);return n;}
}
aspect GenericAspectJ extends GenericAspect<Base> {
public static void main(String []argv) {
Base b = new Base();
String s = b.m4("hello");
if (!s.equals("hello"))
throw new RuntimeException("Not hello?? "+s);
}
}
class Base {}
|