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

Improve handling of Java annotation parameters #2562

Merged
merged 1 commit into from Jul 7, 2022

Conversation

IgnatBeresnev
Copy link
Member

This PR fixes 3 issues that all came from the same place. See the tests, there's one for each issue.

Fixes #2509
Fixes #2551
Fixes #2350

I've also tried to make it so that it doesn't lead to build failures in case some other corner case is not covered, although it might come with some signature bugs for such situations.

Note

Source code

@SimpleAnnotation(clazz = String[].class)

Will be rendered as

@SimpleAnnotation(clazz = String::class)

This is probably incorrect and it might be better to generate Array::class instead, but I've had a look at how we handle such cases for Kotlin sources and it's actually generating String::class, so I think it's better to have the same behaviour for both Kotlin and Java. This is to be discussed and fixed separately as it would require introducing changes to the annotations model.

@IgnatBeresnev IgnatBeresnev merged commit 3332f9f into master Jul 7, 2022
@IgnatBeresnev IgnatBeresnev deleted the java-annotations-cornercases branch July 7, 2022 11:30
IgnatBeresnev added a commit that referenced this pull request Jul 11, 2022
Fixes #2509
Fixes #2551
Fixes #2350

(cherry picked from commit 3332f9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment