30794060a9
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their mutable analogs, depending on the number of receivers a property takes
13 lines
219 B
Kotlin
Vendored
13 lines
219 B
Kotlin
Vendored
import kotlin.reflect.*
|
|
|
|
fun <T> checkSubtype(t: T) = t
|
|
|
|
class A(var g: A) {
|
|
val f: Int = 0
|
|
|
|
fun test() {
|
|
checkSubtype<KProperty1<A, Int>>(::f)
|
|
checkSubtype<KMutableProperty1<A, A>>(::g)
|
|
}
|
|
}
|