Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include annotation type element default value in type tables #5081

Open
knutwannheden opened this issue Feb 21, 2025 · 0 comments
Open

Include annotation type element default value in type tables #5081

knutwannheden opened this issue Feb 21, 2025 · 0 comments
Labels
enhancement New feature or request parser-java

Comments

@knutwannheden
Copy link
Contributor

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser-java
Projects
Status: No status
Development

No branches or pull requests

1 participant