I am trying to call java varargs method from kotlin code. Looks like the compiler accepts there only one parameter rather than a list of parameters or an array. Is this correct? How should I invoke such a method?
Forgot to mention, I use kotlin 8.11 with the corresponding IDEA plugin. (are you planning to release plugin updates for the new versions of kotlin? :))
Where did you learn about that? I thought I'd read all the Kotlin docs and I don't remember this. The varargs section in the docs don't seem to mention it either.
Java variable arguments invocation supports passing an array in place of listing arguments at compile time. Is this ‘spread’ the same as the java way? Or is there still an extra step? If there’s an extra step, is it possible to optimize the spread operation when there is ‘just one array’?