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

21 lines
428 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// KJS_WITH_FULL_RUNTIME
class Template() {
val collected = ArrayList<String>()
operator fun String.unaryPlus() {
collected.add(this@unaryPlus)
}
fun test() {
+ "239"
}
}
fun box() : String {
val u = Template()
u.test()
return if(u.collected.size == 1 && u.collected.get(0) == "239") "OK" else "fail"
}