Files
Nim/tests/reject/trefs.nim
2013-03-16 23:53:07 +01:00

24 lines
384 B
Nim

discard """
file: "trefs.nim"
line: 20
errormsg: "type mismatch"
"""
# test for ref types (including refs to procs)
type
TProc = proc (a, b: int): int {.stdcall.}
proc foo(c, d: int): int {.stdcall.} =
return 0
proc wrongfoo(c, e: int): int {.inline.} =
return 0
var p: TProc
p = foo
write(stdout, "success!")
p = wrongfoo #ERROR_MSG type mismatch