KT-9377 Support is-checks for read-only collections
Intrinsics for is/as/as? with mutable Kotlin collections and related types.
This commit is contained in:
+3
-2
@@ -18,11 +18,12 @@ fun expectUoe(block: () -> Unit) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val map = MyMap<String, Int>() as MutableMap<String, Int>
|
||||
val myMap = MyMap<String, Int>()
|
||||
val map = myMap as java.util.Map<String, Int>
|
||||
|
||||
expectUoe { map.put("", 1) }
|
||||
expectUoe { map.remove("") }
|
||||
expectUoe { map.putAll(map) }
|
||||
expectUoe { map.putAll(myMap) }
|
||||
expectUoe { map.clear() }
|
||||
|
||||
return "OK"
|
||||
|
||||
Reference in New Issue
Block a user