AddToCollectionTransformation checks that the result collection type cannot be changed
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user