diff options
author | cooldome <cdome@bk.ru> | 2018-02-12 20:20:49 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-02-12 21:20:49 +0100 |
commit | 7cbab49645541af01dbd5afac98df637b02a0c0a (patch) | |
tree | 9dcc5b44d6fa5738a6b35e3a17ee864cf362edd1 /tests/exception/tfinally.nim | |
parent | df4f707743879a0ea4363fcef446d89d8b421513 (diff) | |
download | Nim-7cbab49645541af01dbd5afac98df637b02a0c0a.tar.gz |
nested finally bug (#7207)
Diffstat (limited to 'tests/exception/tfinally.nim')
-rw-r--r-- | tests/exception/tfinally.nim | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/exception/tfinally.nim b/tests/exception/tfinally.nim index aa469d9c0..e5315a318 100644 --- a/tests/exception/tfinally.nim +++ b/tests/exception/tfinally.nim @@ -1,6 +1,13 @@ discard """ file: "tfinally.nim" - output: "came\nhere\n3" + output: '''came +here +3 +msg1 +msg2 +finally2 +finally1 +''' """ # Test return in try statement: @@ -17,3 +24,19 @@ proc main: int = echo main() #OUT came here 3 +#bug 7204 +proc nested_finally = + try: + raise newException(KeyError, "msg1") + except KeyError as ex: + echo ex.msg + try: + raise newException(ValueError, "msg2") + except: + echo getCurrentExceptionMsg() + finally: + echo "finally2" + finally: + echo "finally1" + +nested_finally() \ No newline at end of file |