Files
kotlin/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt
Denis Zharkov 4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00

16 lines
444 B
Kotlin
Vendored

// 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<!> (<!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>c1<!>, <!UNUSED_VARIABLE!>c2<!>, c3) in list) {
<!UNUSED_VALUE!><!VAL_REASSIGNMENT!>c1<!> =<!> 1
c3 + 1
}
}