texceptions.nim 359 B

1234567891011121314151617
  1. discard """
  2. cmd: "nim cpp --gc:arc $file"
  3. """
  4. block: # issue #13071
  5. type MyExcept = object of CatchableError
  6. proc gun()=
  7. raise newException(MyExcept, "foo:")
  8. proc fun()=
  9. var a = ""
  10. try:
  11. gun()
  12. except Exception as e:
  13. a = e.msg & $e.name # was segfaulting here for `nim cpp --gc:arc`
  14. doAssert a == "foo:MyExcept"
  15. fun()