tlocktypednode1.nim 238 B

12345678910111213
  1. discard """
  2. errormsg: "typechecked nodes may not be modified"
  3. """
  4. import macros
  5. macro doSomething(arg: typed): untyped =
  6. echo arg.treeREpr
  7. result = arg
  8. result.add newCall(bindSym"echo", newLit(1))
  9. doSomething((echo(1); echo(2)))