mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
Allow wCodegenDecl on lambdas (#8892)
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user