The way to match the same signature in Kotlin is to use a vararg parameter: fun inStream(eventType: Int, action: String?, vararg notes: StamperNote)
. Your conversion requires the caller to wrap the arguments into an array explicitly.
Note that vararg
parameters are, as a rule, never nullable, because in Java there is no good way to distinguish between passing null
as the entire vararg array versus passing null
as a single element of a non-null vararg array.