Files
kotlin/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt
2012-09-05 18:55:16 +04:00

16 lines
294 B
Kotlin

// KT-2667 Support multi-declarations in for-loops in control flow analysis
package d
class A {
fun component1() = 1
fun component2() = 2
fun component3() = 3
}
fun foo(list: List<A>) {
for (var (c1, c2, c3) in list) {
c1 = <!UNUSED_VALUE!>1<!>
c3 + 1
}
}