Files
kotlin-fork/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt
T
2021-05-25 20:39:34 +03:00

17 lines
377 B
Kotlin
Vendored

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