Removing usages of tuples from test data

(KT-2358 Drop tuples)
 #KT-2358 In progress
This commit is contained in:
Andrey Breslav
2012-09-18 13:48:20 +04:00
parent dee5152f9b
commit 5eaa5b396b
64 changed files with 172 additions and 330 deletions
@@ -2,17 +2,17 @@ import java.util.HashMap
fun parseCatalogs(hashMap: Any?) {
val r = toHasMap(hashMap)
if (!r._1) {
if (!r.first) {
return
}
val nodes = r._2
val nodes = r.second
}
fun toHasMap(value: Any?): #(Boolean, HashMap<String, Any?>?) {
fun toHasMap(value: Any?): Pair<Boolean, HashMap<String, Any?>?> {
if(value is HashMap<*, *>) {
return #(true, value as HashMap<String, Any?>)
return Pair(true, value as HashMap<String, Any?>)
}
return #(false, null as HashMap<String, Any?>?)
return Pair(false, null as HashMap<String, Any?>?)
}
fun box() : String {
@@ -1,5 +1,5 @@
fun box(): String {
val a = if(true) {
}
return if (a.toString() == "()") "OK" else "fail"
return if (a.toString() == "Unit.VALUE") "OK" else "fail"
}
@@ -1,9 +1,9 @@
fun main(args: Array<String>?) {
val y: Unit = #() //do not compile
val y: Unit = Unit.VALUE //do not compile
A<Unit>() //do not compile
C<Unit>(#()) //do not compile
C<Unit>(Unit.VALUE) //do not compile
//do not compile
System.out?.println(fff<Unit>(#())) //do not compile
System.out?.println(fff<Unit>(Unit.VALUE)) //do not compile
System.out?.println(id<Unit>(y)) //do not compile
System.out?.println(fff<Unit>(id<Unit>(y)) == id<Unit>(foreach(Array<Int>(0,{0}),{(e : Int) : Unit -> }))) //do not compile
}
@@ -27,7 +27,7 @@ fun t1() : Boolean {
x = x + "45" + y
x = x.substring(3)
x += "aaa"
#()
Unit.VALUE
}
foo()
@@ -43,7 +43,7 @@ fun t2() : Boolean {
x = x + 5 + y
x += 5
x++
#()
Unit.VALUE
}
foo()
x -= 55
@@ -55,7 +55,7 @@ fun t3() : Boolean {
var x = true
val foo = {
x = false
#()
Unit.VALUE
}
foo()
return !x
@@ -67,7 +67,7 @@ fun t4() : Boolean {
val foo = {
x = x + 200.toFloat() + y
x += 18
#()
Unit.VALUE
}
foo()
System.out?.println(x)
@@ -80,7 +80,7 @@ fun t5() : Boolean {
val foo = {
x = x + 200.toDouble() + y
x -= 22
#()
Unit.VALUE
}
foo()
System.out?.println(x)
@@ -94,7 +94,7 @@ fun t6() : Boolean {
x = (x + 20.toByte() + y).toByte()
x += 2
x--
#()
Unit.VALUE
}
foo()
System.out?.println(x)
@@ -105,7 +105,7 @@ fun t7() : Boolean {
var x : Char = 'a'
val foo = {
x = 'b'
#()
Unit.VALUE
}
foo()
System.out?.println(x)
@@ -117,10 +117,10 @@ fun t8() : Boolean {
val foo = {
val bar = {
x = 30.toShort()
#()
Unit.VALUE
}
bar()
#()
Unit.VALUE
}
foo()
return x == 30.toShort()