split SuperGenTest.basicmethod

This commit is contained in:
Stepan Koltsov
2012-02-09 18:39:10 +04:00
parent 8cfc443c93
commit 7ad452109f
4 changed files with 39 additions and 23 deletions
@@ -0,0 +1,17 @@
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";
}