Initial support of @JvmDefault
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
// !API_VERSION: 1.3
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
fun test(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
class TestClass : Test {
|
||||
override fun test(): String {
|
||||
return super.test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return TestClass().test()
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// !API_VERSION: 1.3
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
fun test(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
interface Test2 : Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
override fun test(): String {
|
||||
return super.test()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.test()
|
||||
}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// !API_VERSION: 1.3
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
val prop: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
class TestClass : Test {
|
||||
override val prop: String
|
||||
get() = super.prop
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return TestClass().prop
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// !API_VERSION: 1.3
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
interface Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
val prop: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
interface Test2 : Test {
|
||||
@kotlin.annotations.JvmDefault
|
||||
override val prop: String
|
||||
get() = super.prop
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return object : Test2 {}.prop
|
||||
}
|
||||
Reference in New Issue
Block a user