Files
kotlin-fork/idea/testData/intentions/loopToCallChain/flatMapTo3.kt
T
2016-08-16 17:38:02 +03:00

13 lines
329 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'flatMapTo(){}'"
fun foo(list: List<String>): List<String> {
val target = createCollection()
<caret>for (s in list) {
for (line in s.lines()) {
target.add(line)
}
}
return target
}
fun createCollection() = java.util.ArrayList<String>()