mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
24 lines
642 B
Java
24 lines
642 B
Java
import org.aspectj.testing.Tester;
|
|
|
|
/** @testcase PR#774 interface self-reference by anonymous instance */
|
|
public class AnonymousSelfReference {
|
|
public static void main (String[] args) {
|
|
Tester.expectEvent("run");
|
|
Tester.expectEvent("im");
|
|
I it = new I() { public void im() { Tester.event("im");} };
|
|
it.runnable.run();
|
|
Tester.checkAllEvents();
|
|
}
|
|
}
|
|
|
|
interface I { public void im(); }
|
|
|
|
aspect A {
|
|
Runnable I.runnable = new Runnable() {
|
|
public void run() {
|
|
im(); // comment out to avoid VerifyError
|
|
Tester.event("run");
|
|
}
|
|
};
|
|
}
|