aboutsummaryrefslogtreecommitdiff
path: root/tests/run/array-addition.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/array-addition.scala')
-rw-r--r--tests/run/array-addition.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run/array-addition.scala b/tests/run/array-addition.scala
new file mode 100644
index 000000000..8def48e85
--- /dev/null
+++ b/tests/run/array-addition.scala
@@ -0,0 +1,11 @@
+object Test {
+ def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")")
+
+ def main(args: Array[String]): Unit = {
+ prettyPrintArray(Array(1,2,3) :+ 4)
+ prettyPrintArray(1 +: Array(2,3,4))
+ prettyPrintArray(Array() :+ 1)
+ prettyPrintArray(1 +: Array())
+ }
+}
+