Basic support for "add" to collection used inside the loop

This commit is contained in:
Valentin Kipyatkov
2016-04-06 19:20:08 +03:00
parent d3721e9462
commit f51c5a19dd
20 changed files with 272 additions and 46 deletions
@@ -0,0 +1,12 @@
// 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
}