ttypedsymchoice.nim 438 B

12345678910111213141516171819
  1. # issue #12831
  2. import std/[macros, strutils]
  3. macro dumpRepr(x: typed): untyped =
  4. result = newLit(x.treeRepr & "\n")
  5. doAssert dumpRepr(`$`).startsWith("ClosedSymChoice")
  6. # issue #19446
  7. macro typedVarargs(x: varargs[typed]): untyped =
  8. result = newLit($x[0].kind)
  9. macro typedSingle(x: typed): untyped =
  10. result = newLit($x.kind)
  11. doAssert typedSingle(len) == "nnkClosedSymChoice"
  12. doAssert typedVarargs(len) == "nnkClosedSymChoice"