summary refs log tree commit diff stats
path: root/tests/effects
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-04-23 19:52:33 +0200
committerGitHub <noreply@github.com>2020-04-23 19:52:33 +0200
commiteca8f1d79f712613437918e397f7abb58bc29515 (patch)
tree1f824ca8b78020bed8b76a13d41a3482b14206c0 /tests/effects
parent66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (diff)
downloadNim-eca8f1d79f712613437918e397f7abb58bc29515.tar.gz
Add tests for #8481, #6490 and #4061 (#14083)
Diffstat (limited to 'tests/effects')
-rw-r--r--tests/effects/teffects9.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/effects/teffects9.nim b/tests/effects/teffects9.nim
new file mode 100644
index 000000000..d92668fe9
--- /dev/null
+++ b/tests/effects/teffects9.nim
@@ -0,0 +1,22 @@
+discard """
+  errormsg: "can raise an unlisted exception: ref Exception"
+  line: 16
+"""
+
+# bug #8481
+
+type
+  ParentObj = ref object of RootObj
+  DerivedObj = ref object of ParentObj
+
+method doSome(o: ParentObj) {.base, raises: [].} =
+  discard
+
+method doSome(o: DerivedObj) =
+  raise newException(Exception, "oops, this raised")
+
+proc thisRaises() {.raises: [].} =
+  let o = new(DerivedObj)
+  o.doSome()
+
+thisRaises()