Add some tests on KProperty usage from delegate methods

This commit is contained in:
Alexander Udalov
2015-10-14 18:08:12 +03:00
parent 6a965c9a06
commit 63dfe13c43
4 changed files with 59 additions and 0 deletions
@@ -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"