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

9 lines
386 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexedNotNull{}.mapTo(){}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexedNotNull{}.mapTo(){}'"
fun foo(list: List<String?>, target: MutableList<String>) {
<caret>list
.asSequence()
.mapIndexedNotNull { index, s -> s?.substring(index)?.length }
.mapTo(target) { it.toString() }
}