Files
kotlin-fork/compiler/testData/codegen/box/builtinStubMethods/nonTrivialUpperBound.kt
T
2020-05-28 22:18:20 +03:00

16 lines
337 B
Kotlin
Vendored

// 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"
}
}