Files
Nim/tests/stdlib/tmacros.nim
Aditya Siram 23447ffdce 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 <darkmine956@gmail.com>
2020-12-03 13:40:28 +01:00

10 lines
297 B
Nim

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