tfinally3.nim 408 B

12345678910111213141516171819202122232425262728
  1. discard """
  2. outputsub: '''
  3. false
  4. Within finally->try
  5. '''
  6. exitCode: 1
  7. """
  8. # Test break in try statement:
  9. proc main: bool =
  10. while true:
  11. try:
  12. return true
  13. finally:
  14. break
  15. return false
  16. echo main() #OUT false
  17. # bug #5871
  18. try:
  19. raise newException(Exception, "First")
  20. finally:
  21. try:
  22. raise newException(Exception, "Within finally->try")
  23. except:
  24. echo getCurrentExceptionMsg()