Initial import
This commit is contained in:
commit
405b86068e
324 changed files with 163599 additions and 0 deletions
19
tests/trefs.nim
Executable file
19
tests/trefs.nim
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
# test for ref types (including refs to procs)
|
||||
|
||||
import
|
||||
io
|
||||
|
||||
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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue