mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 14:11:27 +02:00
27 lines
802 B
Java
27 lines
802 B
Java
|
|
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");
|
|
}
|
|
}
|