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:
@@ -13,7 +13,7 @@ fun expectUoe(block: () -> Any) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A<String>() as MutableList<String>
|
||||
val a = A<String>() as java.util.List<String>
|
||||
expectUoe { a.add("") }
|
||||
expectUoe { a.remove("") }
|
||||
expectUoe { a.addAll(a) }
|
||||
@@ -28,7 +28,7 @@ fun box(): String {
|
||||
a.listIterator(0)
|
||||
a.subList(0, 0)
|
||||
|
||||
val b = B() as MutableList<String>
|
||||
val b = B() as java.util.List<String>
|
||||
expectUoe { b.add("") }
|
||||
expectUoe { b.remove("") }
|
||||
expectUoe { b.addAll(b) }
|
||||
|
||||
Reference in New Issue
Block a user