Files
kotlin/compiler/testData/codegen/box/super/basicmethodSuperClass.kt
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

18 lines
346 B
Kotlin

import java.util.ArrayList
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";
}