mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
25 lines
366 B
Kotlin
Vendored
25 lines
366 B
Kotlin
Vendored
// SKIP_JDK6
|
|
// TARGET_BACKEND: JVM
|
|
// FILE: Base.java
|
|
|
|
public interface Base {
|
|
String getValue();
|
|
|
|
default String test() {
|
|
return getValue();
|
|
}
|
|
}
|
|
|
|
// FILE: main.kt
|
|
class Fail : Base {
|
|
override fun getValue() = "Fail"
|
|
}
|
|
|
|
class Derived : Base by Fail() {
|
|
override fun getValue() = "OK"
|
|
}
|
|
|
|
fun box(): String {
|
|
return Derived().test()
|
|
}
|