Allow wCodegenDecl on lambdas (#8892)

This commit is contained in:
LemonBoy
2018-09-07 01:58:49 +02:00
committed by Andreas Rumpf
parent 84eab97fed
commit e81fe6d32f
2 changed files with 14 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ const
lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl,
wNosideeffect, wSideeffect, wNoreturn, wDynlib, wHeader,
wDeprecated, wExtern, wThread, wImportCpp, wImportObjC, wAsmNoStackFrame,
wRaises, wLocks, wTags, wGcSafe}
wRaises, wLocks, wTags, wGcSafe, wCodegenDecl}
typePragmas* = {wImportc, wExportc, wDeprecated, wMagic, wAcyclic, wNodecl,
wPure, wHeader, wCompilerProc, wCore, wFinal, wSize, wExtern, wShallow,
wImportCpp, wImportObjC, wError, wIncompleteStruct, wByCopy, wByRef,

View File

@@ -0,0 +1,13 @@
discard """
targets: "c cpp js"
ccodecheck: "'HELLO'"
"""
when defined(JS):
var foo = proc(): void{.codegenDecl: "/*HELLO*/function $2($3)".} =
echo "baa"
else:
var foo = proc(): void{.codegenDecl: "/*HELLO*/$1 $2 $3".} =
echo "baa"
foo()