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

public class MethodLocalAroundReturns {
    public static void main (String[] args) {
        C c = C.make();
        Tester.check(null != c, "null c");
        Tester.check("ok".equals(c.toString()), "bad c: " + c);
    } 
}

class C {
    static C make() { return null; }
}

aspect A {
    /** @testcase method-local class defined in around return statement */
    C around() : call(C C.make()) {
        return new C() {
                public String toString() { return "ok"; } // bad compiler error here
            };
    }
}