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

12 lines
309 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
fun box(): String {
val m = hashMapOf<String, String?>()
m.put("b", null)
val oldValue = m.getOrPut("b", { "Foo" })
return if (oldValue == "Foo") "OK" else "fail: $oldValue"
}