t15909.nim 254 B

1234567891011121314151617
  1. discard """
  2. action: run
  3. cmd: "nim c --gc:arc $file"
  4. """
  5. proc f1() {.noreturn.} = raise newException(CatchableError, "")
  6. proc f2(y: int): int =
  7. if y != 0:
  8. y
  9. else:
  10. f1()
  11. doAssert f2(5) == 5
  12. doAssertRaises(CatchableError):
  13. discard f2(0)