tvarargsexpr.nim 500 B

123456789101112131415161718192021222324252627282930
  1. discard """
  2. output: '''success
  3. true
  4. true'''
  5. """
  6. #bug #913
  7. import macros
  8. macro thirteen(args: varargs[untyped]): int =
  9. result = newIntLitNode(13)
  10. doAssert(13==thirteen([1,2])) # works
  11. doAssert(13==thirteen(1,2)) # works
  12. doAssert(13==thirteen(1,[2])) # does not work
  13. doAssert(13==thirteen([1], 2)) # does not work
  14. echo "success"
  15. # bug #2545
  16. import macros
  17. macro test(e: varargs[untyped]): untyped =
  18. bindSym"true"
  19. echo test(a)
  20. echo test(fake=90, arguments=80, also="false", possible=true)