For example, you might have function with a complicated signature and varargs:
fun complicated(easy: Boolean = false, hard: Boolean = true, vararg numbers: Int)
It would make sense that you should be able to call this function like so:
complicated(numbers = 1, 2, 3, 4, 5)
Unfortunately the compiler doesn't allow this.
Is it possible to use named arguments for varargs? Are there any clever workarounds?
numbers = *intArrayOf(...)
is the way to go here. – Bailey