mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
20 lines
365 B
Kotlin
Vendored
20 lines
365 B
Kotlin
Vendored
// !LANGUAGE: +JvmFieldInInterface
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// 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
|
|
}
|