summary refs log tree commit diff stats
path: root/tests/generics/tvarargs_vs_generic.nim
blob: 122f3e45325e2104ca78feb4d8d54875b6ae1221 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
discard """
  output: "direct\ngeneric\ngeneric"
"""

proc withDirectType(args: string) =
  echo "direct"

proc withDirectType[T](arg: T) =
  echo "generic"

proc withOpenArray(args: openarray[string]) =
  echo "openarray"

proc withOpenArray[T](arg: T) =
  echo "generic"

proc withVarargs(args: varargs[string]) =
  echo "varargs"

proc withVarargs[T](arg: T) =
  echo "generic"

withDirectType "string"
withOpenArray "string"
withVarargs "string"