Files
kotlin-fork/idea/testData/codegen/traits/multiple.jet
T
2011-09-12 21:23:42 +03:00

16 lines
297 B
Plaintext

trait AL {
fun get(index: Int) : Any? = null
}
trait ALE<T> : AL {
fun getOrNull(index: Int, value : T) = get(index) as? T ?: value
}
class SmartArrayList() : ALE<String> {
}
fun box() : String {
val c = SmartArrayList()
return if("239" == c.getOrNull(0, "239")) "OK" else "fail"
}