21 lines
428 B
Kotlin
Vendored
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"
|
|
}
|