6cb0e5151c
Intrinsics for is/as/as? with mutable Kotlin collections and related types.
14 lines
313 B
Kotlin
Vendored
14 lines
313 B
Kotlin
Vendored
class MyIterator<E : Number> : Iterator<E> {
|
|
override fun next() = null!!
|
|
override fun hasNext() = null!!
|
|
}
|
|
|
|
fun box(): String {
|
|
try {
|
|
(MyIterator<Int>() as java.util.Iterator<Number>).remove()
|
|
return "Fail"
|
|
} catch (e: UnsupportedOperationException) {
|
|
return "OK"
|
|
}
|
|
}
|