Files
kotlin-fork/idea/testData/intentions/loopToCallChain/resultCollectionUsedInsideLoop.kt.after
T
Valentin Kipyatkov f28dca1fd5 Supported forEach
2016-08-16 17:38:12 +03:00

10 lines
246 B
Plaintext
Vendored

// WITH_RUNTIME
import java.util.ArrayList
fun foo(list: List<String>): List<Int> {
val result = ArrayList<Int>()
list
.filter { it.length > result.size }
.forEach { result.add(it.hashCode()) }
return result
}