KT-16535 'provideDelegate' convention is not supported in IR

Implement provideDelegate convention support.
NB delegate type now depends on 'provideDelegate' convention resolution.
This commit is contained in:
Dmitry Petrov
2017-02-28 12:07:34 +03:00
parent 6046b25f56
commit 885f397cdd
14 changed files with 544 additions and 28 deletions
@@ -0,0 +1,12 @@
object Host {
class StringDelegate(val s: String) {
operator fun getValue(receiver: String, p: Any) = receiver + s
}
operator fun String.provideDelegate(host: Any?, p: Any) = StringDelegate(this)
val String.plusK by "K"
val ok = "O".plusK
}