diff options
author | Clyybber <darkmine956@gmail.com> | 2020-04-23 19:52:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 19:52:33 +0200 |
commit | eca8f1d79f712613437918e397f7abb58bc29515 (patch) | |
tree | 1f824ca8b78020bed8b76a13d41a3482b14206c0 /tests/effects | |
parent | 66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (diff) | |
download | Nim-eca8f1d79f712613437918e397f7abb58bc29515.tar.gz |
Add tests for #8481, #6490 and #4061 (#14083)
Diffstat (limited to 'tests/effects')
-rw-r--r-- | tests/effects/teffects9.nim | 22 |
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() |