Add some tests on KProperty usage from delegate methods
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate {
|
||||
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"
|
||||
Reference in New Issue
Block a user