teffects7.nim 281 B

1234567891011121314151617
  1. discard """
  2. errormsg: "can raise an unlisted exception: ref ValueError"
  3. line: 10
  4. """
  5. {.push warningAsError[Effect]: on.}
  6. proc foo() {.raises: [].} =
  7. try:
  8. discard
  9. except KeyError:
  10. raise newException(ValueError, "foo")
  11. except Exception:
  12. discard
  13. foo()
  14. {.pop.}