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