tproctype_pragmas.nim 423 B

1234567891011121314151617181920
  1. discard """
  2. output: '''39
  3. 40'''
  4. """
  5. # bug 1802
  6. # Ensure proc pragmas are attached properly:
  7. proc makeStdcall(s: string): (proc(i: int) {.stdcall.}) =
  8. (proc (x: int) {.stdcall.} = echo x)
  9. proc makeNimcall(s: string): (proc(i: int)) {.stdcall.} =
  10. (proc (x: int) {.nimcall.} = echo x)
  11. let stdc: proc (y: int) {.stdcall.} = makeStdcall("bu")
  12. let nimc: proc (y: int) {.closure.} = makeNimcall("ba")
  13. stdc(39)
  14. nimc(40)