Files
kotlin-fork/compiler/testData/codegen/box/delegation/kt8154.kt
T
2018-08-09 14:22:46 +03:00

20 lines
304 B
Kotlin
Vendored

interface A<T> {
fun foo(): T
}
interface B<T> : A<T>
class BImpl<T>(a: A<T>) : B<T>, A<T> by a
fun box(): String {
val b: B<String> = BImpl(object : A<String> {
override fun foo() = "OK"
})
if (b.foo() != "OK") return "fail 1"
val a: A<String> = b
return a.foo()
}