mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
31 lines
492 B
Kotlin
Vendored
31 lines
492 B
Kotlin
Vendored
// !API_VERSION: 1.3
|
|
// !ENABLE_JVM_DEFAULT
|
|
// JVM_TARGET: 1.8
|
|
// WITH_RUNTIME
|
|
|
|
interface Test {
|
|
@JvmDefault
|
|
fun test(): String {
|
|
return inlineProp
|
|
}
|
|
|
|
fun testDefaultImpls(): String {
|
|
return inlineProp
|
|
}
|
|
|
|
@JvmDefault
|
|
private inline val inlineProp: String
|
|
get() = "OK"
|
|
|
|
}
|
|
|
|
class TestClass : Test {
|
|
|
|
}
|
|
|
|
fun box(): String {
|
|
val foo = TestClass()
|
|
if (foo.test() != "OK") return "fail: ${foo.test()}"
|
|
return foo.testDefaultImpls()
|
|
}
|