Files
kotlin-fork/compiler/testData/codegen/box/delegation/simple1.0.kt
T
2021-11-20 03:37:31 +03:00

28 lines
504 B
Kotlin
Vendored

// !LANGUAGE: -NoDelegationToJavaDefaultInterfaceMembers
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: don't support legacy feature
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// FILE: Base.java
public interface Base {
String getValue();
default String test() {
return getValue();
}
}
// FILE: main.kt
class OK : Base {
override fun getValue() = "OK"
}
fun box(): String {
val z = object : Base by OK() {
override fun getValue() = "Fail"
}
return z.test()
}