Files
kotlin-fork/compiler/testData/codegen/box/classes/kt508.kt
T
2016-11-21 18:20:33 +03:00

17 lines
489 B
Kotlin
Vendored

// TODO: Enable for JS when it supports Java class library.
// IGNORE_BACKEND: JS
// fails on JS with TypeError: imported$plus is not a function, it is undefined.
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) = put(key, value)
fun box() : String {
val commands : MutableMap<String, String> = HashMap()
commands["c1"] = "239"
if(commands["c1"] != "239") return "fail"
commands["c1"] += "932"
return if(commands["c1"] == "239932") "OK" else "fail"
}