tnestedreturn2.nim 395 B

1234567891011121314151617181920
  1. discard """
  2. outputsub: "Error: unhandled exception: Problem [OSError]"
  3. exitcode: "1"
  4. """
  5. proc test4() =
  6. try:
  7. try:
  8. raise newException(OSError, "Problem")
  9. except OSError:
  10. return
  11. finally:
  12. discard
  13. # Should cause unhandled exception error,
  14. # but could cause segmentation fault if
  15. # exceptions are not handled properly.
  16. test4()
  17. raise newException(OSError, "Problem")