Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/useReflectionOnKProperty.kt
T
2016-11-09 21:41:12 +03:00

20 lines
433 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// 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"