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:
Dmitry Petrov
2015-09-30 18:23:26 +03:00
parent 35881198c3
commit 6cb0e5151c
32 changed files with 1291 additions and 50 deletions
@@ -5,7 +5,7 @@ class MyIterator<T>(val v: T): Iterator<T> {
fun box(): String {
try {
(MyIterator<String>("") as MutableIterator<String>).remove()
(MyIterator<String>("") as java.util.Iterator<String>).remove()
throw AssertionError()
} catch (e: UnsupportedOperationException) {
return "OK"