If I have a function ```fun foo(a: Int, b: Long, c...
# language-proposals
k
If I have a function
Copy code
fun foo(a: Int, b: Long, c: Double)
and a variable of type RequestBody
Copy code
data class RequestBody(val a: Int, val b: Long, val c: Double)
and I call it like this:
Copy code
foo(requestBody.a, requestBody.b, requestBody.c)
It would be nice if the spread operator worked on these arguments (not just varargs) so that I could do this:
Copy code
foo(*requestBody)
Or is there some existing way that this can be done in a succinct way?
e
closest I can think of is
with (requestBody) { foo(a,b,c) }
, but might exist better ways 🙂
👍 1
j
requestBody.run{foo(a,b,c)} as well