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