aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/PR83645.java
blob: fa64a9cb820f564be3d07940520e2db50e3d8a12 (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
import org.aspectj.lang.NoAspectBoundException;

interface IP {}

/** @testcase PR83645 pertypewithin on interface */
public class PR83645 implements IP {
    public static void main(String[] args) {
        try {
            boolean yes = (PT.aspectOf(IP.class) instanceof PT);
            throw new Error("expected NoAspectBoundException, got instance?: " + yes);
        } catch (NoAspectBoundException e) {
            // ok
        }
    }
}
aspect PT pertypewithin(IP+) {
    static int INDEX;
    final int index = INDEX++;
    public PT() {
    }
    public String toString() {
        return "me " + index;
    }
}