mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
18 lines
345 B
Kotlin
Vendored
18 lines
345 B
Kotlin
Vendored
// 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";
|
|
}
|