summaryrefslogtreecommitdiffstats
path: root/tests/errors/DeclareError.java
blob: 7ad6cd1e34d95df49405b6d61eb25909e3602204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import org.aspectj.testing.Tester;

public class DeclareError {
    public static void main(String[] args) {
        new C().bad();
    }
}

class C {
    public void m() {
        new C().bad();
    }

    public void bad() { }
}

class D {
    public void m() {
        new C().bad();
    }
}


aspect A {
    declare error: call(void C.bad()) && !within(C):
        "can only call bad from C";
}