Files
kotlin-fork/idea/testData/intentions/loopToCallChain/introduceIndex/indexPlusPlusIsNotLastStatement_indexUsedAfterIncrement.kt
T
2016-08-23 22:47:42 +03:00

13 lines
298 B
Kotlin
Vendored

// WITH_RUNTIME
// IS_APPLICABLE: false
// IS_APPLICABLE_2: false
fun foo(list: List<String>): Int? {
var index = 0
<caret>for (s in list) {
if (s.isBlank()) continue
val x = s.length * index
index++
if ((x + index) % 3 == 0) return x
}
return null
}