summary refs log tree commit diff stats
path: root/tests/effects
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/effects
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/effects')
-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()
:15:34 +0100 committer GitHub <noreply@github.com> 2020-03-25 19:15:34 +0100 fix deprecations and other warnings (#13748)' href='/ahoang/Nim/commit/tests/async/tnewasyncudp.nim?h=devel&id=5b55aa52d05ff911d64febc973bed1f0c2d97d25'>5b55aa52d ^
b53f13cbe ^





3d556a971 ^
ddea990a7 ^
b53f13cbe ^


3d556a971 ^



55cb959a6 ^
3d556a971 ^


b53f13cbe ^

















55cb959a6 ^
b53f13cbe ^
bdd35c972 ^
3d556a971 ^

b53f13cbe ^
c48050579 ^
b53f13cbe ^


38505e31c ^
5b55aa52d ^


b53f13cbe ^




38505e31c ^
b53f13cbe ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111