Files
kotlin/compiler/testData/codegen/box/builtinStubMethods/IteratorWithRemove.kt
Dmitry Petrov 6cb0e5151c KT-9377 Support is-checks for read-only collections
Intrinsics for is/as/as? with mutable Kotlin collections and related types.
2015-10-02 15:17:00 +03:00

12 lines
256 B
Kotlin
Vendored

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 java.util.Iterator<String>).remove()
return "OK"
}