google / google/ksp

[ksp2] Type of `vararg` annotation parameter differs for source vs. dependency

Open
#2,322 3 comments 0 reactions 0 assignees View on GitHub
core P3
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

For an annotation:
```
annotation class VarargAnnotation(vararg val strings: String)
```

The `KSType` for the `strings` parameter appears to differ depending on whether the annotation is declared in the sources of the module being compiled or in another module that is a dependency.
- Sources: `Array`
- Dependency: `String`

Either seems reasonable (`String` is _maybe_ more correct given that the parameter also has `isVararg = true` and the fact that `vararg`s and array parameters aren't totally equivalent in Kotlin the way they are in Java), but they should probably be consistent.

The type of the `strings` _property_ for the class seems to be `Array` in both cases, as I'd expect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.