grmartin / stab-language

Automatically exported from code.google.com/p/stab-language
Apache License 2.0
0 stars 0 forks source link

Missing validation on annotation scope #43

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The following code:

package test {

    [Retention(RetentionPolicy.RUNTIME)]
    [Target({ ElementType.FIELD })]
    public interface EnumCode : Annotation {
        int value();
    }

    [EnumCode(1)]
    public enum Codes {

        [EnumCode(1)]
        Code1,

        [EnumCode(2)]
        Code2
    }
}

does not validate the scope of the annotation, since it is declared only to be 
valid on field types, not on classes.

Original issue reported on code.google.com by ice.ta...@gmail.com on 28 Feb 2011 at 9:43