fun sum(a: Int, b: Int) = a + b
val x = 1.to(2)
I'm looking for:
sum.tupled(x), orsum(*x)
Of course, none of the above compiles with Kotlin 1.1.3-2. So am I stuck with sum(x.first, x.second)?
Edit:
Generalizing on the useful answers, I think this is the closest thing for now:
fun <P1, P2, R> Function2<P1,P2,R>.tupled(x: Pair<P1, P2>): R = invoke(x.first, x.second)