mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
13 lines
242 B
Kotlin
Vendored
13 lines
242 B
Kotlin
Vendored
interface A<T> {
|
|
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)
|
|
}
|