Files
kotlin-fork/compiler/testData/codegen/box/builtinStubMethods/nonTrivialUpperBound.kt
T
2018-12-21 16:09:11 +01: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"
}
}