KT-504 array like expressions with type parameters

This commit is contained in:
Alex Tkachman
2011-11-15 12:42:51 +02:00
parent 74654c467c
commit aaed9b0325
5 changed files with 196 additions and 60 deletions
@@ -0,0 +1,16 @@
import java.util.HashMap
import java.util.Map
import java.io.*
fun <K, V> Map<K, V>.set(key : K, value : V) = put(key, value)
fun box() : String {
val commands : Map<String, String> = HashMap()
commands["c1"] = "239"
if(commands["c1"] != "239") return "fail"
commands["c1"] += "932"
return if(commands["c1"] == "239932") "OK" else "fail"
}