aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/varargs.scala
blob: bbfcac841a71287abd99b0af6904011415d8cdf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
object varargs {
  List(1, 2, 3)
  def g(x: Int*) = x.length
  g(1, 2, 3, 4)
  val x = if (true) 1 else 2
  def foo[T](x: T, y: T): T = x
  foo(1, 2)
  val xs = 1 :: 2 :: Nil
  g(xs: _*)
  g(Nil: _*)
  g(1)
  g()

  def f(x: Int): Unit = ()
  def f(x: Int*): Unit = ()
  f(1)
}