tmsginfo.nim 605 B

12345678910111213141516171819202122232425
  1. discard """
  2. nimout: '''tmsginfo.nim(21, 1) Warning: foo1 [User]
  3. tmsginfo.nim(22, 13) template/generic instantiation of `foo2` from here
  4. tmsginfo.nim(15, 10) Warning: foo2 [User]
  5. tmsginfo.nim(23, 1) Hint: foo3 [User]
  6. tmsginfo.nim(19, 7) Hint: foo4 [User]
  7. '''
  8. """
  9. import macros
  10. macro foo1(y: untyped): untyped =
  11. warning("foo1", y)
  12. macro foo2(y: untyped): untyped =
  13. warning("foo2")
  14. macro foo3(y: untyped): untyped =
  15. hint("foo3", y)
  16. macro foo4(y: untyped): untyped =
  17. hint("foo4")
  18. proc x1() {.foo1.} = discard
  19. proc x2() {.foo2.} = discard
  20. proc x3() {.foo3.} = discard
  21. proc x4() {.foo4.} = discard