summary refs log tree commit diff stats
path: root/tests/stdlib/tvarargs.nim
blob: d56be154bc9ae71af10ab00e9dab46965ffd4f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  targets: "c js"
  matrix: "--gc:refc; --gc:arc"
"""


template main =
  proc hello(x: varargs[string]): seq[string] =
    var s: seq[string]
    s.add x
    s

  doAssert hello() == @[]
  doAssert hello("a1") == @["a1"]
  doAssert hello("a1", "a2") == @["a1", "a2"]

static: main()
main()