From 23447ffdce7415e2313654a61bdd9a23803f6538 Mon Sep 17 00:00:00 2001 From: Aditya Siram Date: Thu, 3 Dec 2020 06:40:28 -0600 Subject: Fixes #16219, `hasArgOfName` ignoring argument sets. (#16233) * Fixes #16219, `hasArgOfName` ignoring argument sets. * Fix test and simplify ident traversal. * Moved test into a block and removed some boilerplate. * Fix some argument formatting. * use ..< * Change the preceding line too Co-authored-by: Clyybber --- tests/stdlib/tmacros.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/stdlib/tmacros.nim (limited to 'tests/stdlib') diff --git a/tests/stdlib/tmacros.nim b/tests/stdlib/tmacros.nim new file mode 100644 index 000000000..0cc1e340c --- /dev/null +++ b/tests/stdlib/tmacros.nim @@ -0,0 +1,9 @@ +import macros + +block: # hasArgOfName + macro m(u: untyped): untyped = + for name in ["s","i","j","k","b","xs","ys"]: + doAssert hasArgOfName(params u,name) + doAssert not hasArgOfName(params u,"nonexistent") + + proc p(s: string; i,j,k: int; b: bool; xs,ys: seq[int] = @[]) {.m.} = discard -- cgit 1.4.1-2-gfad0