Files
kotlin-fork/compiler/testData/codegen/box/delegation/mixed.kt
T
Mikhael Bogdanov a4206a543a Skip test on JDK 6
2018-10-22 16:32:55 +02:00

35 lines
589 B
Kotlin
Vendored

// SKIP_JDK6
// TARGET_BACKEND: JVM
// FILE: Base.java
public interface Base extends KBase {
String getValue();
default String test() {
return getValue();
}
}
// FILE: main.kt
interface KBase {
fun getValue(): String
fun test(): String
}
class Fail : Base {
override fun getValue() = "Fail"
}
fun box(): String {
val z1 = object : KBase by Fail() {
override fun getValue() = "OK"
}
if (z1.test() != "Fail") return "fail 1"
val z2 = object : Base by Fail() {
override fun getValue() = "OK"
}
return z2.test()
}