teffects1.nim 368 B

123456789101112131415161718192021
  1. discard """
  2. file: "system.nim"
  3. errormsg: "can raise an unlisted exception: ref IOError"
  4. """
  5. type
  6. TObj = object {.pure, inheritable.}
  7. TObjB = object of TObj
  8. a, b, c: string
  9. IO2Error = ref object of IOError
  10. proc forw: int {. .}
  11. proc lier(): int {.raises: [IO2Error].} =
  12. writeLine stdout, "arg"
  13. proc forw: int =
  14. raise newException(IOError, "arg")