diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2019-01-27 10:32:44 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-27 10:32:44 +0100 |
commit | 3ce6b2acb9ce21d33f0f14161b0abf89a9ff7af9 (patch) | |
tree | 5e41524a1234659d0ac5d3ff61b124c076eecbb3 /tests/effects | |
parent | a0623a235664cb4d575f9c4575a70c7db41eac4e (diff) | |
download | Nim-3ce6b2acb9ce21d33f0f14161b0abf89a9ff7af9.tar.gz |
Fix exception tracking in try blocks (#10455)
Exceptions raised inside a nkFinally/nkExcept block are not caught by the block itself. Fixes #3886
Diffstat (limited to 'tests/effects')
-rw-r--r-- | tests/effects/teffects7.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/effects/teffects7.nim b/tests/effects/teffects7.nim new file mode 100644 index 000000000..1cd144459 --- /dev/null +++ b/tests/effects/teffects7.nim @@ -0,0 +1,14 @@ +discard """ + errormsg: "can raise an unlisted exception: ref FloatingPointError" + line: 10 +""" + +proc foo() {.raises: [].} = + try: + discard + except KeyError: + raise newException(FloatingPointError, "foo") + except Exception: + discard + +foo() |