teffects9.nim 418 B

1234567891011121314151617181920212223
  1. discard """
  2. errormsg: "can raise an unlisted exception: ref Exception"
  3. line: 16
  4. """
  5. # bug #8481
  6. type
  7. ParentObj = ref object of RootObj
  8. DerivedObj = ref object of ParentObj
  9. method doSome(o: ParentObj) {.base, raises: [].} =
  10. discard
  11. method doSome(o: DerivedObj) =
  12. raise newException(Exception, "oops, this raised")
  13. proc thisRaises() {.raises: [].} =
  14. let o = new(DerivedObj)
  15. o.doSome()
  16. thisRaises()