mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
33 lines
549 B
Kotlin
Vendored
33 lines
549 B
Kotlin
Vendored
// !API_VERSION: 1.3
|
|
// !JVM_DEFAULT_MODE: compatibility
|
|
// FILE: Simple.java
|
|
|
|
public interface Simple extends KInterface {
|
|
default String test() {
|
|
return KInterface.DefaultImpls.test2(this);
|
|
}
|
|
}
|
|
|
|
// FILE: Foo.java
|
|
public class Foo implements Simple {
|
|
|
|
}
|
|
|
|
// FILE: main.kt
|
|
// JVM_TARGET: 1.8
|
|
// WITH_RUNTIME
|
|
|
|
interface KInterface {
|
|
@JvmDefault
|
|
fun test2(): String {
|
|
return "OK"
|
|
}
|
|
}
|
|
|
|
|
|
fun box(): String {
|
|
val result = Foo().test()
|
|
if (result != "OK") return "fail 1: ${result}"
|
|
|
|
return Foo().test2()
|
|
} |