Intention to simplify for using destructing declaration

This commit is contained in:
Natalia Ukhorskaya
2016-01-13 14:47:02 +03:00
parent 5667a92472
commit ea3ba6f534
34 changed files with 631 additions and 0 deletions
@@ -0,0 +1,12 @@
// WITH_RUNTIME
fun main(args: Array<String>) {
val list = listOf(MyClass(1, 2, 3), MyClass(2, 3, 4))
for (<caret>klass in list) {
val a1 = klass.a
val c1 = klass.c
val b1 = klass.b
}
}
data class MyClass(val a: Int, val b: Int, val c: Int)