Files
kotlin-fork/compiler/testData/codegen/classes/delegationGenericArgUpperBound.kt
T
Alexander Udalov 288e3a7b40 Cast arguments to proper types when generating delegates
Also minor refactoring in a couple places to adopt this style
2012-10-30 16:47:50 +04:00

13 lines
246 B
Kotlin

trait A<T: Number> {
fun foo(t: T): String
}
class Derived(a: A<Int>) : A<Int> by a
fun box(): String {
val o = object : A<Int> {
override fun foo(t: Int) = if (t == 42) "OK" else "Fail $t"
}
return Derived(o).foo(42)
}