blob: 543e683d48d7a5dca9d00f151ff337e124e727e9 [file] [log] [blame]
// TARGET_BACKEND: JVM
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"
}
}