diff options
Diffstat (limited to 'tests/pureJava/ParentUsingChild.java')
-rw-r--r-- | tests/pureJava/ParentUsingChild.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pureJava/ParentUsingChild.java b/tests/pureJava/ParentUsingChild.java new file mode 100644 index 000000000..2133628a3 --- /dev/null +++ b/tests/pureJava/ParentUsingChild.java @@ -0,0 +1,26 @@ + +import org.aspectj.testing.*; + +/** @testcase PUREJAVA PR#728 interface using preceding subinterface in its definition (order matters) */ +interface Child extends Parent { + interface Toy { } +} + +interface Parent { // order matters - must be after Child + Child.Toy battle(); +} + +public class ParentUsingChild { + public static void main (String[] args) { + Tester.check(Parent.class.isAssignableFrom(Child.class), + "!Parent.class.isAssignableFrom(Child.class)"); + Parent p = new Parent() { + public Child.Toy battle() { + return new Child.Toy(){}; + } + }; + Child.Toy battle = p.battle(); + Tester.check(battle instanceof Child.Toy, + "!battle instanceof Child.Toy"); + } +} |