Add tests for #8481, #6490 and #4061 (#14083)

This commit is contained in:
Clyybber 2020-04-23 19:52:33 +02:00 • committed by GitHub
commit eca8f1d79f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 0 deletions

View file

@ -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()