summary refs log tree commit diff stats
path: root/tests/stdlib/tmacros.nim
blob: 0cc1e340c720c8d525055b7f0c699b98f7848f3c (plain) (blame)
1
2
3
4
5
6
7
8
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