Simplify property hierarchy in reflection
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their mutable analogs, depending on the number of receivers a property takes
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KMemberProperty
|
||||
import kotlin.reflect.KProperty1
|
||||
|
||||
open class Base {
|
||||
val foo: Int = 42
|
||||
@@ -10,6 +10,6 @@ open class Derived : Base()
|
||||
|
||||
fun test() {
|
||||
val o = Base::foo
|
||||
checkSubtype<KMemberProperty<Base, Int>>(o)
|
||||
checkSubtype<KProperty1<Base, Int>>(o)
|
||||
checkSubtype<Int>(o.get(Derived()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user