summary refs log tree commit diff stats
path: root/tests/effects/tstrict_effects2.nim
blob: acc0a0540a2c88495713fdb033b5dbd57559401b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
discard """
  errormsg: "can raise an unlisted exception: Exception"
  line: 23
"""

{.push warningAsError[Effect]: on.}
{.experimental: "strictEffects".}

# bug #13905

proc atoi(v: cstring): cint {.importc: "atoi", cdecl, raises: [].}

type Conv = proc(v: cstring): cint {.cdecl, raises: [].}

var x: Conv = atoi

# bug #17475

type
  Callback = proc()

proc f(callback: Callback) {.raises: [].} =
  callback()

proc main =
  f(proc () = raise newException(IOError, "IO"))

main()