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

[ksp2] Annotation value vararg is handled as single item (in java source file only) #2272

Open
acejingbo opened this issue Dec 26, 2024 · 0 comments

Comments

@acejingbo
Copy link

acejingbo commented Dec 26, 2024

For an annotation

@interface MyAnnotation2 {
    String[] value() default {"3", "5", "7"};
}

If you do @MyAnnotation2("4") in java library, kotlin library, or kotlin source file, KSP2 will consider value to be an string array ["4"] correctly
But in java source file, KSP2 will consider it an single item "4"

Repro

acejingbo@dde34da

See test fail for MyClass.java because value should be [4] but is 4, but it does not fail for MyClassKotlin.kt and MyClassInLib.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant