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:
+4
-7
@@ -7,12 +7,9 @@ val y: String get() = "y"
|
||||
|
||||
fun testX() {
|
||||
val xx = ::x
|
||||
checkSubtype<KMutableTopLevelProperty<Int>>(xx)
|
||||
checkSubtype<KMutableTopLevelVariable<Int>>(xx)
|
||||
checkSubtype<KTopLevelProperty<Int>>(xx)
|
||||
checkSubtype<KTopLevelVariable<Int>>(xx)
|
||||
checkSubtype<KMutableProperty0<Int>>(xx)
|
||||
checkSubtype<KProperty0<Int>>(xx)
|
||||
checkSubtype<KMutableProperty<Int>>(xx)
|
||||
checkSubtype<KMutableVariable<Int>>(xx)
|
||||
checkSubtype<KProperty<Int>>(xx)
|
||||
checkSubtype<KCallable<Int>>(xx)
|
||||
|
||||
@@ -23,8 +20,8 @@ fun testX() {
|
||||
|
||||
fun testY() {
|
||||
val yy = ::y
|
||||
checkSubtype<KMutableTopLevelProperty<String>>(<!TYPE_MISMATCH!>yy<!>)
|
||||
checkSubtype<KTopLevelVariable<String>>(yy)
|
||||
checkSubtype<KMutableProperty0<String>>(<!TYPE_MISMATCH!>yy<!>)
|
||||
checkSubtype<KProperty0<String>>(yy)
|
||||
checkSubtype<KMutableProperty<String>>(<!TYPE_MISMATCH!>yy<!>)
|
||||
checkSubtype<KProperty<String>>(yy)
|
||||
checkSubtype<KCallable<String>>(yy)
|
||||
|
||||
Reference in New Issue
Block a user