Nested multi-declarations


#1

Multi-declarations look like a basic form of destructuring. I was wondering if there are plans to support nested multi-declarations to allow something like this:

``

fun <T> List<T>.component1(): T = this.get(0)
fun <T> List<T>.component2(): List<T> = this.subList(1, this.size())

fun main(args : Array<String>) {
  val list = arrayList(1, 2, 3, 4)
  val (first, (second, rest)) = list // first=1, second=2, rest=[3,4]
}


#2

We decided not to implement any more complex forms of destructuring than basic multi-declaration in the first version of Kotlin.