mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
16 lines
269 B
Kotlin
Vendored
16 lines
269 B
Kotlin
Vendored
// See KT-14999
|
|
|
|
object Obj {
|
|
var key = ""
|
|
var value = ""
|
|
|
|
operator fun set(k: String, v: ((String) -> Unit) -> Unit) {
|
|
key += k
|
|
v { value += it }
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
Obj["O"] = label@{ it("K") }
|
|
return Obj.key + Obj.value
|
|
} |