Allow wCodegenDecl on lambdas (#8892)
This commit is contained in:
parent
84eab97fed
commit
e81fe6d32f
2 changed files with 14 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
13
tests/ccgbugs/tcodegendecllambda.nim
Normal file
13
tests/ccgbugs/tcodegendecllambda.nim
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue