Files
kotlin/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt
2012-08-23 14:25:13 +04:00

18 lines
317 B
Kotlin

// KT-2667 Support multi-declarations in for-loops in control flow analysis
package d
import java.util.List
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
}
}