diff options
Diffstat (limited to 'tests/stdlib/tmacros.nim')
-rw-r--r-- | tests/stdlib/tmacros.nim | 9 |
1 files changed, 9 insertions, 0 deletions
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 |