fixes #1802
This commit is contained in:
parent
e81c8314b3
commit
a32237a011
1 changed files with 19 additions and 0 deletions
19
tests/parser/tproctype_pragmas.nim
Normal file
19
tests/parser/tproctype_pragmas.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
output: '''39
|
||||
40'''
|
||||
"""
|
||||
|
||||
# bug 1802
|
||||
# Ensure proc pragmas are attached properly:
|
||||
|
||||
proc makeStdcall(s: string): (proc(i: int) {.stdcall.}) =
|
||||
(proc (x: int) {.stdcall.} = echo x)
|
||||
|
||||
proc makeNimcall(s: string): (proc(i: int)) {.stdcall.} =
|
||||
(proc (x: int) {.nimcall.} = echo x)
|
||||
|
||||
let stdc: proc (y: int) {.stdcall.} = makeStdcall("bu")
|
||||
let nimc: proc (y: int) {.closure.} = makeNimcall("ba")
|
||||
|
||||
stdc(39)
|
||||
nimc(40)
|
||||
Loading…
Add table
Add a link
Reference in a new issue