mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
14 lines
383 B
Kotlin
14 lines
383 B
Kotlin
fun box() : String {
|
|
try {
|
|
removeInIterator.bar(object : Iterator<Int> {
|
|
public override fun hasNext(): Boolean = false
|
|
public override fun next(): Int = 1
|
|
})
|
|
}
|
|
catch (e: UnsupportedOperationException) {
|
|
if (e.getMessage() == "Mutating method called on a Kotlin Iterator")
|
|
return "OK"
|
|
}
|
|
return "fail"
|
|
}
|