summaryrefslogtreecommitdiffstats
path: root/tests/new/introTypeMissing/Inner.java
blob: ee3b8f52b28a0f812336deb39b409b419cb463d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import org.aspectj.testing.Tester; 

public class Inner {
    public static void main(String[] args) {
        Tester.expectEvent("inner");
        new TargetClass().inner();
        Tester.checkAllEvents();
    }
}

aspect InstanceOfAspect {
    /** @testcase  Introduced type unavailable to qualified new expressions in introduced methods */
    public void TargetClass.inner() {
        InnerClass i = this.new InnerClass();
        if (!i.valid()) Util.fail("this.new InnerClass()");
        InnerClass j = getThis().new InnerClass();
        if (!j.valid()) Util.fail("getThis().new InnerClass()");
        Util.signal("inner");
    }
}