Support @JvmField on interface properties
#KT-15807 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +JvmFieldInInterface
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
interface Foo {
|
||||
companion object {
|
||||
@JvmField
|
||||
val value = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val field = Foo.Companion::value.javaField!!
|
||||
return field.get(null) as String
|
||||
}
|
||||
Reference in New Issue
Block a user