diff options
Diffstat (limited to 'tests/hasmember/HasPrivateFieldInherited.aj')
-rw-r--r-- | tests/hasmember/HasPrivateFieldInherited.aj | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/hasmember/HasPrivateFieldInherited.aj b/tests/hasmember/HasPrivateFieldInherited.aj new file mode 100644 index 000000000..b4d7b9abc --- /dev/null +++ b/tests/hasmember/HasPrivateFieldInherited.aj @@ -0,0 +1,28 @@ +public aspect HasPrivateFieldInherited { + + declare parents : D && hasfield(* printer) implements Printable; + + public static void main(String[] args) { + C c = new C(); + if ((c instanceof Printable)) { + throw new RuntimeException("declare parents : hasfield failed on super"); + } + D d = new D(); + if ((d instanceof Printable)) { + throw new RuntimeException("declare parents : hasfield failed on sub"); + } + + } +} + +class C { + + private String printer; + +} + +class D extends C { + +} + +interface Printable {};
\ No newline at end of file |