summary refs log tree commit diff stats
path: root/tests/effects/teffects7.nim
blob: 9b7fbf5f01669494848309952a04bd8a65b1f410 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  errormsg: "can raise an unlisted exception: ref ValueError"
  line: 10
"""
{.push warningAsError[Effect]: on.}
proc foo() {.raises: [].} =
  try:
    discard
  except KeyError:
    raise newException(ValueError, "foo")
  except Exception:
    discard

foo()

{.pop.}