summaryrefslogblamecommitdiff
path: root/test/files/run/array-addition.scala
blob: 8def48e85cd452dcdef3ccc56638d1add624ea7d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
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())
  }
}