mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
29 lines
374 B
Kotlin
Vendored
29 lines
374 B
Kotlin
Vendored
// FILE: IBase.java
|
|
|
|
interface IBase {
|
|
default String bar() {
|
|
return "OK";
|
|
}
|
|
}
|
|
|
|
// FILE: Kotlin.kt
|
|
open class Base {
|
|
fun foo() = "OK"
|
|
}
|
|
|
|
class C : Base(), IBase {
|
|
val lambda1 = {
|
|
super.foo()
|
|
}
|
|
|
|
val lambda2 = {
|
|
super.bar()
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
if (C().lambda1() != "OK") return "fail 1"
|
|
|
|
return C().lambda2()
|
|
}
|