Introduce propertyDelegated method in delegates

This commit is contained in:
Denis Mekhanikov
2014-09-20 17:42:02 +04:00
parent 9e38d207f2
commit c4bfa0edca
35 changed files with 597 additions and 42 deletions
@@ -0,0 +1,14 @@
class Delegate {
var count = 0
fun get(t: Any?, p: PropertyMetadata) {}
fun propertyDelegated(vararg p: PropertyMetadata) { count++ }
}
val delegate = Delegate()
val prop1 by delegate
val prop2 by delegate
fun box(): String {
return if(delegate.count == 2) "OK" else "fail"
}