aboutsummaryrefslogblamecommitdiff
path: root/tests/run/array-addition.scala
blob: 09a1b0badaceece950babbf62073e0c7c8d017e8 (plain) (tree)
1
2
3
4
5
6
7
8





                                                                                

                                       


   
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[Int]() :+ 1)
    prettyPrintArray(1 +: Array[Int]())
  }
}