Skip to content

Include annotation type element default value in type tables #5081

@knutwannheden

Description

@knutwannheden

For annotation types like the following it would make sense to also include the element default value in the type tables, as the compiler validates that the annotations provide a value for all elements without defaults. Thus if the parser warnings are enabled, there will be warnings logged when compiling against type tables.

More importantly, the values will be missing in the LST type attribution (cf. JavaType.Annotation), which in turn means that downstream recipes won't be able to act on any element default values.

@interface AnnA {
    AnnB[] b() default {@AnnB(val = 2)};
}

@interface AnnB {
    int val() default 1;
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions