30794060a9
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their mutable analogs, depending on the number of receivers a property takes
11 lines
197 B
Kotlin
Vendored
11 lines
197 B
Kotlin
Vendored
import kotlin.reflect.KProperty1
|
|
|
|
class A<T> {
|
|
val result = "OK"
|
|
}
|
|
|
|
fun box(): String {
|
|
val k : KProperty1<A<*>, *> = A::class.properties.single()
|
|
return k.get(A<String>()) as String
|
|
}
|