mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
16 lines
427 B
Kotlin
Vendored
16 lines
427 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS
|
|
|
|
class MyIterator<T>(val v: T): Iterator<T> {
|
|
override fun next(): T = v
|
|
override fun hasNext(): Boolean = true
|
|
}
|
|
|
|
fun box(): String {
|
|
try {
|
|
(MyIterator<String>("") as java.util.Iterator<String>).remove()
|
|
throw AssertionError()
|
|
} catch (e: UnsupportedOperationException) {
|
|
return "OK"
|
|
}
|
|
} |