summary refs log blame commit diff stats
path: root/tests/arc/texceptions.nim
blob: c55b463fc9f48dcff6466c28dabe41d9758fe66f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                       
discard """
  cmd: "nim cpp --gc:arc $file"
"""

block: # issue #13071
  type MyExcept = object of CatchableError
  proc gun()=
    raise newException(MyExcept, "foo:")
  proc fun()=
    var a = ""
    try:
      gun()
    except Exception as e:
      a = e.msg & $e.name # was segfaulting here for `nim cpp --gc:arc`
    doAssert a == "foo:MyExcept"
  fun()