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,10 @@
// WITH_RUNTIME
import java.util.HashSet
fun foo(map: Map<Int, String>): Collection<Int> {
val result = HashSet<Int>()
<caret>for (s in map.values) {
result.add(s.length)
}
return result
}