blob: f91cff76cbfdb30d9f93ec81fcddb04c51206e52 (
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
|
// ITD of a method onto a generic inner type - working example
interface I {
interface J<T> {
interface K {}
}
}
aspect Bang {
public int I.J<P>.intro(P t) {return 42;}
}
class Impl implements I {
class InnerImpl implements J<String> {
class InnerInnerImpl implements K {}
}
}
public class ExampleD {
public static void main(String []argv) {
Impl i = new Impl();
Impl.InnerImpl j = i.new InnerImpl();
Impl.InnerImpl.InnerInnerImpl k = j.new InnerInnerImpl();
System.out.println(j.intro("foo"));
}
}
|