69e5444ddf
#KT-1703 Fixed #KT-361 Fixed #KT-3920 Fixed #KT-3988 Fixed #KT-4247 Fixed #KT-4586 Fixed #KT-4603 Fixed #KT-591 Fixed
18 lines
341 B
Kotlin
18 lines
341 B
Kotlin
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
//KT-4586 this@ does not work for builders
|
|
|
|
fun string(init: StringBuilder.() -> Unit): String{
|
|
val answer = StringBuilder()
|
|
answer.init()
|
|
return answer.toString()
|
|
}
|
|
|
|
val str = string @l{
|
|
append("hello, ")
|
|
|
|
val sub = string {
|
|
append("world!")
|
|
this@l.append(this)
|
|
}
|
|
}
|