summaryrefslogtreecommitdiffstats
path: root/tests/errors/MultipleIntros.java
blob: 1dc1f330d5892b68231893084d086ab4119d1ff8 (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
29
30
31
32
public class MultipleIntros {
    public static void main(String[] args) { new C().publicM(); }
}

class C {
    private void privateM() {}
    public void publicM() { System.out.println("from C"); }
    
    private int privateF;
    public int publicF;
}


aspect A {
    private int C.privateF; // should be okay
    public int C.publicF; //ERROR conflicts with existing field

    private int C.privateFA;
    private int C.privateFA; //ERROR conflicts with the above

    private void C.privateM() {} // should be okay
    public void C.publicM() { System.out.println("from A"); } //ERROR conflicts with existing method
}

aspect AO {
    static aspect AI1 {
        private int C.privateFA;
    }
    static aspect AI2 {
        private int C.privateFA; //ERROR conflicts with field from AI1
    }
}