You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ExampleD.java 537B

1234567891011121314151617181920212223242526
  1. // ITD of a method onto a generic inner type - working example
  2. interface I {
  3. interface J<T> {
  4. interface K {}
  5. }
  6. }
  7. aspect Bang {
  8. public int I.J<P>.intro(P t) {return 42;}
  9. }
  10. class Impl implements I {
  11. class InnerImpl implements J<String> {
  12. class InnerInnerImpl implements K {}
  13. }
  14. }
  15. public class ExampleD {
  16. public static void main(String []argv) {
  17. Impl i = new Impl();
  18. Impl.InnerImpl j = i.new InnerImpl();
  19. Impl.InnerImpl.InnerInnerImpl k = j.new InnerInnerImpl();
  20. System.out.println(j.intro("foo"));
  21. }
  22. }