Files
kotlin/compiler/testData/codegen/box/super/basicmethodSuperClass.kt
2019-11-19 11:00:09 +03:00

20 lines
400 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: NATIVE
class N() : ArrayList<Any>() {
override fun add(el: Any) : Boolean {
if (!super<ArrayList>.add(el)) {
throw Exception()
}
return false
}
}
fun box(): String {
val n = N()
if (n.add("239")) return "fail"
if (n.get(0) == "239") return "OK";
return "fail";
}