mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
17 lines
307 B
Nim
17 lines
307 B
Nim
# 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
|
|
|