TupleN classes and their usages replaced by Pair and Triple

(KT-2358 Drop tuples)

 #KT-2358 In Progress
This commit is contained in:
Andrey Breslav
2012-09-07 21:23:38 +04:00
parent 8333448f10
commit 89fd0526cf
18 changed files with 58 additions and 59 deletions
+2 -2
View File
@@ -15,10 +15,10 @@ library("jsonGet")
public fun Json.get(paramName : String) : Any? = js.noImpl
library("jsonFromTuples")
public fun json(vararg pairs : Tuple2<String, Any?>) : Json = js.noImpl
public fun json(vararg pairs : Pair<String, Any?>) : Json = js.noImpl
library("jsonFromTuples")
public fun json2(pairs : Array<Tuple2<String, Any?>>) : Json = js.noImpl
public fun json2(pairs : Array<Pair<String, Any?>>) : Json = js.noImpl
library("jsonAddProperties")
public fun Json.add(other : Json) : Json = js.noImpl
+2 -2
View File
@@ -13,14 +13,14 @@ public fun <K, V> MutableMap<K, V>.set(key : K, value : V): Unit {
*
* @includeFunctionBody ../../test/MapTest.kt createUsingTuples
*/
public inline fun <K,V> hashMap(vararg values: #(K,V)): HashMap<K,V> {
public inline fun <K,V> hashMap(vararg values: Pair<K,V>): HashMap<K,V> {
val answer = HashMap<K,V>()
/**
TODO replace by this simpler call when we can pass vararg values into other methods
answer.putAll(values)
*/
for (v in values) {
answer.put(v._1, v._2)
answer.put(v.first, v.second)
}
return answer
}