mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 00:21:32 +00:00
To better emphasize the fact that all returned properties require an instance of the class they are declared in. Another issue was that 'Some::class.extensionProperties' was sometimes incorrectly perceived as "get all extension properties available on the class Some"
11 lines
193 B
Kotlin
Vendored
11 lines
193 B
Kotlin
Vendored
import kotlin.reflect.*
|
|
|
|
class A<T> {
|
|
val result = "OK"
|
|
}
|
|
|
|
fun box(): String {
|
|
val k: KProperty1<A<*>, *> = A::class.memberProperties.single()
|
|
return k.get(A<String>()) as String
|
|
}
|