teffects2.nim 404 B

123456789101112131415161718192021
  1. discard """
  2. errormsg: "can raise an unlisted exception: ref IOError"
  3. line: 19
  4. """
  5. {.push warningAsError[Effect]: on.}
  6. type
  7. TObj {.pure, inheritable.} = object
  8. TObjB = object of TObj
  9. a, b, c: string
  10. EIO2 = ref object of IOError
  11. proc forw: int {.raises: [].}
  12. proc lier(): int {.raises: [IOError].} =
  13. writeLine stdout, "arg"
  14. proc forw: int =
  15. raise newException(IOError, "arg")
  16. {.pop.}