summary refs log tree commit diff stats
path: root/tests/trefs.nim
blob: ab39340884b0878f777fdaea53712109a09ce4fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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