Files
kotlin/compiler/testData/codegen/box/builtinStubMethods/abstractMember.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

21 lines
378 B
Kotlin
Vendored

abstract class A : Iterator<String> {
abstract fun remove(): Unit
}
class B(var result: String) : A() {
override fun next() = ""
override fun hasNext() = false
override fun remove() {
result = "OK"
}
}
fun box(): String {
val a = B("Fail") as java.util.Iterator<String>
a.next()
a.hasNext()
a.remove()
return (a as B).result
}