Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt
T
2020-11-09 16:04:43 +03:00

18 lines
343 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_STRING_BUILDER
// KJS_WITH_FULL_RUNTIME
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()