Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt
T
2016-12-12 23:14:05 +03:00

15 lines
315 B
Kotlin
Vendored

// WITH_RUNTIME
object Host {
class StringDelegate(val s: String) {
operator fun getValue(receiver: String, p: Any) = receiver + s
}
operator fun String.toDelegateFor(host: Any?, p: Any) = StringDelegate(this)
val String.plusK by "K"
val ok = "O".plusK
}
fun box(): String = Host.ok