mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
15 lines
240 B
Kotlin
Vendored
15 lines
240 B
Kotlin
Vendored
class A {
|
|
private val sb: StringBuilder = StringBuilder()
|
|
|
|
operator fun String.unaryPlus() {
|
|
sb.append(this)
|
|
}
|
|
|
|
fun foo(): String {
|
|
+"OK"
|
|
return sb.toString()!!
|
|
}
|
|
}
|
|
|
|
fun box(): String = A().foo()
|