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] resolved type of vararg parameter in functions changed vs KSP1 #2379

Closed
mcarleio opened this issue Mar 17, 2025 · 1 comment · Fixed by #2381
Closed

[KSP2] resolved type of vararg parameter in functions changed vs KSP1 #2379

mcarleio opened this issue Mar 17, 2025 · 1 comment · Fixed by #2381

Comments

@mcarleio
Copy link

Having a function like this:

interface Greeter {
    fun hello(vararg names: String) 
}

When going over the vararg paramter, you have a KSValueParameter with it.isVararg = true (both KSP1 and KSP2).

But when you resolve the type of the value paramter, you get different results with KSP1 vs KSP2:

  • KSP1: it.type.resolve() = String
  • KSP2: it.type.resolve() = Array<out String>

Is this intended?

Background is, that I am developing Konvert which needs to know the exact type.

@mcarleio
Copy link
Author

The documentation is also not clear here, as it states vice-versa.

vararg parameters

  • KSP1: Considered as an Array type
  • KSP2: Not considered as an Array type

@ting-yuan ting-yuan linked a pull request Mar 19, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant