diff options
Diffstat (limited to 'test/files/run/tuples.scala')
-rw-r--r-- | test/files/run/tuples.scala | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/files/run/tuples.scala b/test/files/run/tuples.scala index b03167adee..ff1b53fd11 100644 --- a/test/files/run/tuples.scala +++ b/test/files/run/tuples.scala @@ -1,30 +1,30 @@ import Function._ object Test extends Application { - var xyz: (int, String, boolean) = _ + var xyz: (Int, String, Boolean) = _ xyz = (1, "abc", true) Console.println(xyz) xyz match { case (1, "abc", true) => Console.println("OK") } - def func(x : int, y : String, z : double) : unit = { - Console.println("x = " + x + "; y = " + y + "; z = " + z); - } + def func(x: Int, y: String, z: Double) { + Console.println("x = " + x + "; y = " + y + "; z = " + z); + } - def params = (2, "xxx", 3.14159) // (*****) + sef params = (2, "xxx", 3.14159) // (*****) - tupled(func _)(params) // call the function with all the params at once - func(2, "xxx", 3.14159) // the same call - (func _).apply(2, "xxx", 3.14159) // the same call + tupled(func _)(params) // call the function with all the params at once + func(2, "xxx", 3.14159) // the same call + (func _).apply(2, "xxx", 3.14159) // the same call - // Composing a tuple - def t = (1, "Hello", false) + // Composing a tuple + def t = (1, "Hello", false) - // Decomposing a tuple - val (i, s, b) = t + // Decomposing a tuple + val (i, s, b) = t - // all the assertions are passed - assert(i == 1) - assert(s == "Hello") - assert(b == false) + // all the assertions are passed + assert(i == 1) + assert(s == "Hello") + assert(b == false) } |