Rename toDelegateFor to provideDelegate.

This commit is contained in:
Stanislav Erokhin
2016-12-12 14:56:16 +03:00
parent db5250a614
commit 9dc9fb578f
71 changed files with 278 additions and 276 deletions
@@ -0,0 +1,16 @@
import kotlin.reflect.KProperty
var log = ""
class UserDataProperty<in R>(val key: String) {
operator fun getValue(thisRef: R, desc: KProperty<*>) = thisRef.toString() + key
operator fun setValue(thisRef: R, desc: KProperty<*>, value: String?) { log += "set"}
}
var String.calc: String by UserDataProperty("K")
fun box(): String {
return "O".calc
}