Introduce KClass.members, make properties/extensionProperties extensions
To avoid significant growth of KClass and KPackage interfaces
This commit is contained in:
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
var String.id: String
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import kotlin.reflect.KMutableProperty2
|
||||
import kotlin.reflect.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class C(var state: String) {
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import kotlin.reflect.KProperty1
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A<T> {
|
||||
val result = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val k : KProperty1<A<*>, *> = A::class.properties.single()
|
||||
val k: KProperty1<A<*>, *> = A::class.properties.single()
|
||||
return k.get(A<String>()) as String
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
import kotlin.reflect.KMutableProperty2
|
||||
import kotlin.reflect.*
|
||||
|
||||
var storage = "before"
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A(val readonly: String) {
|
||||
var mutable: String = "before"
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
import kotlin.reflect.KProperty1
|
||||
import kotlin.reflect.KProperty2
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
val foo: String = "member"
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import kotlin.reflect.IllegalPropertyAccessException
|
||||
import kotlin.reflect.KProperty1
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.accessible
|
||||
|
||||
class Result {
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import kotlin.reflect.IllegalPropertyAccessException
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.accessible
|
||||
|
||||
class A {
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
import kotlin.reflect.*
|
||||
|
||||
open class A(private val p: Int)
|
||||
class B : A(42)
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import kotlin.reflect.IllegalPropertyAccessException
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.accessible
|
||||
import kotlin.reflect.KMutableProperty1
|
||||
|
||||
class A(param: String) {
|
||||
protected var v: String = param
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.kotlin
|
||||
|
||||
class A(param: String) {
|
||||
|
||||
Reference in New Issue
Block a user