tredef.nim 552 B

123456789101112131415161718192021222324252627282930
  1. template foo(a: int, b: string) = discard
  2. foo(1, "test")
  3. proc bar(a: int, b: string) = discard
  4. bar(1, "test")
  5. template foo(a: int, b: string) {.redefine.} = bar(a, b)
  6. foo(1, "test")
  7. block:
  8. proc bar(a: int, b: string) = discard
  9. template foo(a: int, b: string) = discard
  10. foo(1, "test")
  11. bar(1, "test")
  12. proc baz =
  13. proc foo(a: int, b: string) = discard
  14. proc foo(b: string) =
  15. template bar(a: int, b: string) = discard
  16. bar(1, "test")
  17. foo("test")
  18. block:
  19. proc foo(b: string) = discard
  20. foo("test")
  21. foo(1, "test")
  22. baz()