Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/useReflectionOnKProperty.kt
T
Alexander Udalov 2564a2f91f Do not include kotlin-reflect at runtime by default in codegen tests
Change some tests to either include reflection or to avoid using it
2016-03-09 10:25:38 +03:00

17 lines
337 B
Kotlin
Vendored

// WITH_REFLECT
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): String {
p.parameters
p.returnType
p.annotations
return p.toString()
}
}
val prop: String by Delegate()
fun box() = if (prop == "val prop: kotlin.String") "OK" else "Fail: $prop"