mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 14:03:23 +00:00
* fix #12558
* Update compiler/pragmas.nim
(cherry picked from commit 673c5990c6)
This commit is contained in:
@@ -896,7 +896,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
of wMagic: processMagic(c, it, sym)
|
||||
of wCompileTime:
|
||||
noVal(c, it)
|
||||
incl(sym.flags, sfCompileTime)
|
||||
if comesFromPush:
|
||||
if sym.kind in {skProc, skFunc}:
|
||||
incl(sym.flags, sfCompileTime)
|
||||
else:
|
||||
incl(sym.flags, sfCompileTime)
|
||||
#incl(sym.loc.flags, lfNoDecl)
|
||||
of wGlobal:
|
||||
noVal(c, it)
|
||||
|
||||
15
tests/pragmas/t12558.nim
Normal file
15
tests/pragmas/t12558.nim
Normal file
@@ -0,0 +1,15 @@
|
||||
discard """
|
||||
nimout: '''@["1", "2", "3"]'''
|
||||
"""
|
||||
|
||||
import sequtils
|
||||
|
||||
{.push compile_time.}
|
||||
|
||||
proc foo =
|
||||
echo map_it([1, 2, 3], $it)
|
||||
|
||||
{.pop.}
|
||||
|
||||
static:
|
||||
foo()
|
||||
Reference in New Issue
Block a user