Basic support for "add" to collection used inside the loop
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user