diff options
Diffstat (limited to 'tests/exception/tfinally3.nim')
-rw-r--r-- | tests/exception/tfinally3.nim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/exception/tfinally3.nim b/tests/exception/tfinally3.nim new file mode 100644 index 000000000..9053d397d --- /dev/null +++ b/tests/exception/tfinally3.nim @@ -0,0 +1,27 @@ +discard """ + outputsub: ''' +false +Within finally->try +''' + exitCode: 1 +""" +# Test break in try statement: + +proc main: bool = + while true: + try: + return true + finally: + break + return false + +echo main() #OUT false + +# bug #5871 +try: + raise newException(Exception, "First") +finally: + try: + raise newException(Exception, "Within finally->try") + except: + echo getCurrentExceptionMsg() |