From a32237a0117321636b062ae5b1e0d96ff1f95979 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 21 Mar 2015 21:05:59 +0100 Subject: [PATCH] fixes #1802 --- tests/parser/tproctype_pragmas.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/parser/tproctype_pragmas.nim diff --git a/tests/parser/tproctype_pragmas.nim b/tests/parser/tproctype_pragmas.nim new file mode 100644 index 0000000000..8c7acd0cfe --- /dev/null +++ b/tests/parser/tproctype_pragmas.nim @@ -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)