summaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr119570/ParameterizedDP.java
blob: 1a9e015a43490447044b0f11532f61179feab346 (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
33
package bugs;

import bugsOtherPackage.INode;
import bugsOtherPackage.NodeImpl;

// comments in this bug relate to what happened on AspectJ5 M4
public class ParameterizedDP {

    public static void main(String[] args) {
//        // 1) compile-time error here without 
//        //    {unneeded} subaspect declare-parent
//        // Tag as INode<Tag, Tag> from PC extends NodeImpl<Tag, Tag>
//        ((TaggedTexts.Tag) null).getParent();    
        TaggedTexts.Tag tag1 = new TaggedTexts.Tag();
        TaggedTexts.Tag tag2 = new TaggedTexts.Tag();
        tag1.getParent();
        tag1.setParent(tag2);
        if (!tag1.getParent().equals(tag2)) throw new RuntimeException("");
    }

}
class TaggedTexts {

    public static class Text {  }

    public static class Tag {  }
    static aspect PC extends NodeImpl<Tag, Tag> {
//        // unneeded declare-parents duplicates one in NodeImpl
//        // when here, get spurious error message
//        // when commented out, d-p fails and get compiler error at 1) above
//        declare parents : Tag implements INode<Tag,Tag>;
    }
}