mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 08:31:38 +00:00
Leave only 3*2 = 6 classes: KProperty0, KProperty1, KProperty2 and their mutable analogs, depending on the number of receivers a property takes
16 lines
242 B
Kotlin
Vendored
16 lines
242 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
|
|
import kotlin.reflect.KProperty1
|
|
|
|
open class Base {
|
|
val foo: Int = 42
|
|
}
|
|
|
|
open class Derived : Base()
|
|
|
|
fun test() {
|
|
val o = Base::foo
|
|
checkSubtype<KProperty1<Base, Int>>(o)
|
|
checkSubtype<Int>(o.get(Derived()))
|
|
}
|