Files
kotlin-fork/compiler/testData/codegen/box/builtinStubMethods/nonTrivialUpperBound.kt
T
2016-11-09 21:41:12 +03:00

17 lines
409 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
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"
}
}