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

AnnotationReference.toAnnotationSpec() generates faulty code when argument is varargs #687

Open
matejdro opened this issue Feb 13, 2023 · 0 comments
Labels
bug Something isn't working custom code generator Related to the compiler-api module

Comments

@matejdro
Copy link

When input annotation has vararg parameters (for example, @Suppress annotation), AnnotationReference.toAnnotationSpec() will generate new annotation with named parameters, which is not valid (vararg parameters should not be named).

For example, @Suppres("unused") will be converted to @Suppress(names = "unused").

This will cause the compilation of the generated kotlin file to fail with the Assigning single elements to varargs in named form is forbidden error.

@vRallev vRallev added bug Something isn't working custom code generator Related to the compiler-api module labels Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working custom code generator Related to the compiler-api module
Projects
None yet
Development

No branches or pull requests

2 participants