tinnerouterproc.nim 403 B

123456789101112131415161718192021
  1. block: # #20002
  2. proc bar(x: int): int = 10
  3. template foo =
  4. proc bar(x: int): int {.gensym.} = x + 2
  5. doAssert bar(3) == 5
  6. discard 3.bar # evaluates to 10 but only check if it compiles for now
  7. block:
  8. foo()
  9. block: # issue #23813
  10. template r(body: untyped) =
  11. proc x() {.gensym.} =
  12. body
  13. template g() =
  14. r:
  15. let y = 0
  16. r:
  17. proc y() = discard
  18. y()
  19. g()