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

9 lines
309 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.forEach{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.forEach{}'"
fun foo(list: List<String>) {
list
.asSequence()
.mapIndexed { index, s -> s.length * index }
.forEach { println(it) }
}