Files
kotlin/compiler/testData/codegen/box/extensionFunctions/kt1953_class.kt
2019-11-19 11:00:09 +03:00

17 lines
295 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// 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()