Files
kotlin-fork/compiler/testData/codegen/box/traits/withRequired/generic.kt
T
2015-05-12 19:43:17 +02:00

16 lines
324 B
Kotlin
Vendored

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