summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2019-01-27 10:32:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-01-27 10:32:44 +0100
commit3ce6b2acb9ce21d33f0f14161b0abf89a9ff7af9 (patch)
tree5e41524a1234659d0ac5d3ff61b124c076eecbb3 /tests
parenta0623a235664cb4d575f9c4575a70c7db41eac4e (diff)
downloadNim-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')
-rw-r--r--tests/effects/teffects7.nim14
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()