Files
kotlin-fork/compiler/testData/codegen/classes/delegationGenericLongArg.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
289 B
Kotlin

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