From cbe3c993b677a8a79d651a3797bc915f6e0bdf1e Mon Sep 17 00:00:00 2001 From: flywind Date: Wed, 24 Feb 2021 06:44:10 -0600 Subject: [PATCH] close #15563 add testcase (#17168) * remove unnecessary when statement * remove outdated codes * close #15563 * Update tests/typerel/t15563.nim Co-authored-by: Timothee Cour * address comments * tiny Co-authored-by: Timothee Cour --- tests/stdlib/tvarargs.nim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/stdlib/tvarargs.nim diff --git a/tests/stdlib/tvarargs.nim b/tests/stdlib/tvarargs.nim new file mode 100644 index 0000000000..d56be154bc --- /dev/null +++ b/tests/stdlib/tvarargs.nim @@ -0,0 +1,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()