I understand there’s no way to use destructuring i...
# announcements
a
I understand there’s no way to use destructuring in
init
blocks with properties as targets? I was hoping to do something like:
Copy code
class Foo(bar: Bar) {
    val spams: Collection<String>
    val notSpams: Collection<String>
    init {
        (spams, notSpams) = bar.items.partition { it.isSpam() }
    }
}
Or better yet:
Copy code
class Foo(bar: Bar) {
    val (spams, notSpams) = bar.items.partition { it.isSpam() }
}