mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
16 lines
290 B
Kotlin
16 lines
290 B
Kotlin
class A {
|
|
companion object B {
|
|
var state: String = "12345"
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val p = A.B::state
|
|
|
|
if (p.name != "state") return "Fail state: ${p.name}"
|
|
if (p.get(A.B) != "12345") return "Fail value: ${p.get(A.B)}"
|
|
p.set(A.B, "OK")
|
|
|
|
return p[A.B]
|
|
}
|