From c4eddb3fdafe3494fa1b1300bcbf1314b7540490 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 12 Feb 2015 14:56:42 +0100 Subject: ordinary parameters can follow a varargs parameter --- tests/overload/tparams_after_varargs.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/overload/tparams_after_varargs.nim (limited to 'tests/overload') diff --git a/tests/overload/tparams_after_varargs.nim b/tests/overload/tparams_after_varargs.nim new file mode 100644 index 000000000..a93e280b9 --- /dev/null +++ b/tests/overload/tparams_after_varargs.nim @@ -0,0 +1,17 @@ +discard """ + output: '''a 1 b 2 x @[3, 4, 5] y 6 z 7 +yay +12''' +""" + +proc test(a, b: int, x: varargs[int]; y, z: int) = + echo "a ", a, " b ", b, " x ", @x, " y ", y, " z ", z + +test 1, 2, 3, 4, 5, 6, 7 + +template takesBlock(a, b: int, x: varargs[expr]; blck: stmt) = + blck + echo a, b + +takesBlock 1, 2, "some", 0.90, "random stuff": + echo "yay" -- cgit 1.4.1-2-gfad0