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

12 lines
258 B
Kotlin
Vendored

// WITH_RUNTIME
import java.util.ArrayList
fun foo(list: List<String>): List<Int> {
val result = ArrayList<Int>()
<caret>for (s in list) {
if (s.length > result.size) {
result.add(s.hashCode())
}
}
return result
}