aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features164/declareMixin/CaseQ.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features164/declareMixin/CaseQ.java')
-rw-r--r--tests/features164/declareMixin/CaseQ.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/features164/declareMixin/CaseQ.java b/tests/features164/declareMixin/CaseQ.java
new file mode 100644
index 000000000..dedcabae9
--- /dev/null
+++ b/tests/features164/declareMixin/CaseQ.java
@@ -0,0 +1,32 @@
+// TESTING: factory return type implements two interfaces, both should be mixed as specified
+import org.aspectj.lang.annotation.*;
+
+public class CaseQ {
+ public static void main(String[]argv) {
+ ((I)new CaseQ()).foo();
+ ((J)new CaseQ()).goo();
+ }
+}
+
+aspect X {
+ @DeclareMixin(value="CaseQ",interfaces={I.class,J.class})
+ public static C createImplementation1() {return new C();}
+
+}
+
+interface I {
+ void foo();
+}
+
+interface J {
+ void goo();
+}
+
+class C implements I,J {
+ public void foo() {
+ System.out.println("foo() running");
+ }
+ public void goo() {
+ System.out.println("goo() running");
+ }
+}