Files
kotlin/compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt
Alexander Udalov 30794060a9 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
2015-07-10 20:10:09 +03:00

17 lines
303 B
Kotlin
Vendored

// !CHECK_TYPE
import kotlin.reflect.KProperty1
class A<T>(val t: T) {
val foo: T = t
}
fun bar() {
val x = A<String>::foo
checkSubtype<KProperty1<A<String>, String>>(x)
checkSubtype<KProperty1<A<String>, Any?>>(x)
val y = A<*>::foo
checkSubtype<KProperty1<A<*>, Any?>>(y)
}