blob: 6a9d03b61c7dda5cfeac4f7d5e9b5e8105598986 (
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
|
// here A is modified to implement SimpleI<B> where B is a type var reference
// passed to the generic aspect
import java.util.*;
abstract aspect GenericAspect<A,B> {
interface SimpleI<L> {}
declare parents: A implements SimpleI<B>;
public N SimpleI<N>.m4(N n) { System.err.println(n);return n;}
}
aspect GenericAspectI extends GenericAspect<Base,String> {
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 {}
|