trefs.nim 368 B

123456789101112131415161718192021222324
  1. discard """
  2. file: "trefs.nim"
  3. line: 20
  4. errormsg: "type mismatch"
  5. """
  6. # test for ref types (including refs to procs)
  7. type
  8. TProc = proc (a, b: int): int {.stdcall.}
  9. proc foo(c, d: int): int {.stdcall.} =
  10. return 0
  11. proc wrongfoo(c, e: int): int {.inline.} =
  12. return 0
  13. var p: TProc
  14. p = foo
  15. write(stdout, "success!")
  16. p = wrongfoo #ERROR_MSG type mismatch