AddToCollectionTransformation checks that the result collection type cannot be changed

This commit is contained in:
Valentin Kipyatkov
2016-04-19 18:45:33 +03:00
parent f51c5a19dd
commit db0028c11e
14 changed files with 286 additions and 34 deletions
@@ -0,0 +1,10 @@
// WITH_RUNTIME
import java.util.HashSet
fun foo(map: Map<Int, String>): MutableCollection<String> {
val result = HashSet<String>()
<caret>for (s in map.values) {
result.add(s)
}
return result
}