Klitos Kyriacou
10/13/2021, 8:57 PMfun foo(a: Int, b: Long, c: Double)
and a variable of type RequestBody
data class RequestBody(val a: Int, val b: Long, val c: Double)
and I call it like this:
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:
foo(*requestBody)
Or is there some existing way that this can be done in a succinct way?Emil Kantis
10/13/2021, 9:03 PMwith (requestBody) { foo(a,b,c) }
, but might exist better ways 🙂ephemient
10/13/2021, 9:04 PMjimn
10/14/2021, 6:49 AM