summaryrefslogtreecommitdiff
path: root/test/files/run/repl-parens.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-02 00:18:57 +0000
committerPaul Phillips <paulp@improving.org>2011-07-02 00:18:57 +0000
commitf346e54d24847e0529ce1e5ee43e47a038a4961e (patch)
tree7c8ab24d02900eabba77d133a44959a8c764dfad /test/files/run/repl-parens.check
parent56917143ae6da7a8da532c8b0a45d64b04f6986b (diff)
downloadscala-f346e54d24847e0529ce1e5ee43e47a038a4961e.tar.gz
scala-f346e54d24847e0529ce1e5ee43e47a038a4961e.tar.bz2
scala-f346e54d24847e0529ce1e5ee43e47a038a4961e.zip
Wholesale backport of scala/tools/nsc/interpret...
Wholesale backport of scala/tools/nsc/interpreter with small adjustments to compile against 2.9.0-1. This commit passes all the tests and is mima-verified binary compatible.
Diffstat (limited to 'test/files/run/repl-parens.check')
-rw-r--r--test/files/run/repl-parens.check58
1 files changed, 58 insertions, 0 deletions
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check
new file mode 100644
index 0000000000..f41c2e74bd
--- /dev/null
+++ b/test/files/run/repl-parens.check
@@ -0,0 +1,58 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> (2)
+res0: Int = 2
+
+scala> (2 + 2)
+res1: Int = 4
+
+scala> ((2 + 2))
+res2: Int = 4
+
+scala> ((2 + 2))
+res3: Int = 4
+
+scala> ( (2 + 2))
+res4: Int = 4
+
+scala> ( (2 + 2 ) )
+res5: Int = 4
+
+scala> 5 ; ( (2 + 2 ) ) ; ((5))
+res6: Int = 5
+
+scala> (((2 + 2)), ((2 + 2)))
+res7: (Int, Int) = (4,4)
+
+scala> (((2 + 2)), ((2 + 2)), 2)
+res8: (Int, Int, Int) = (4,4,2)
+
+scala> ((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3) mkString)
+res9: String = 4423
+
+scala>
+
+scala> 55 ; ((2 + 2)) ; (1, 2, 3)
+res10: (Int, Int, Int) = (1,2,3)
+
+scala>
+
+scala> () => 5
+res11: () => Int = <function0>
+
+scala> 55 ; () => 5
+res12: () => Int = <function0>
+
+scala> () => { class X ; new X }
+res13: () => java.lang.Object with ScalaObject = <function0>
+
+scala>
+
+scala> def foo(x: Int)(y: Int)(z: Int) = x+y+z
+foo: (x: Int)(y: Int)(z: Int)Int
+
+scala> foo(5)(10)(15)+foo(5)(10)(15)
+res14: Int = 60
+
+scala>