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.

ParentsFail.java 442B

12345678910111213141516171819202122
  1. public class ParentsFail {
  2. public static void main(String[] args) {
  3. I i = new C1(); // CE incompatible
  4. i.m();
  5. }
  6. }
  7. class C1 {
  8. public void m() { System.out.println("m"); }
  9. }
  10. class C2 {}
  11. class C3 extends C2 {}
  12. interface I {
  13. void m();
  14. }
  15. aspect A {
  16. declare parents: C2 implements I; // CE can't implement
  17. declare parents: C2 extends C3; // CE circular
  18. declare parents: C1 extends C1; // not considered a CE, just does nothing
  19. }