mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
12 lines
253 B
Kotlin
12 lines
253 B
Kotlin
class MyIterator<T>(val v: T): Iterator<T> {
|
|
override fun next(): T = v
|
|
override fun hasNext(): Boolean = true
|
|
|
|
public fun remove() {}
|
|
}
|
|
|
|
fun box(): String {
|
|
(MyIterator<String>("") as MutableIterator<String>).remove()
|
|
return "OK"
|
|
}
|