Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/reflection/properties/privateToThisAccessors.kt
T
2015-04-07 20:20:40 +03:00

17 lines
291 B
Kotlin
Vendored

import kotlin.reflect.jvm.*
class K<in T : String> {
private var t: T
get() = "OK" as T
set(value) {}
fun run(): String {
val p = ::t
p.accessible = true
p.set(this, "" as T)
return p.get(this)
}
}
fun box() = K<String>().run()