tbreak_must_exec_finally.nim 380 B

1234567891011121314151617181920212223242526
  1. discard """
  2. output: '''
  3. finally handler 8
  4. do not duplicate this one
  5. '''
  6. """
  7. # bug #15243
  8. import asyncdispatch
  9. proc f() {.async.} =
  10. try:
  11. while true:
  12. try:
  13. await sleepAsync(400)
  14. break
  15. finally:
  16. var localHere = 8
  17. echo "finally handler ", localHere
  18. finally:
  19. echo "do not duplicate this one"
  20. when isMainModule:
  21. waitFor f()