Files
kotlin-fork/idea/testData/intentions/loopToCallChain/indexPlusPlusInsideExpression_indexUsedBeforeIncrement2.kt.after
T

8 lines
292 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.mapIndexed{}.firstOrNull{}'"
fun foo(list: List<String>): Int? {
return list
.mapIndexed { index, s -> s.length * index }
.mapIndexed { index, x -> x * index }
.firstOrNull { it <= 1000 }
}