const view types; fixes some cases from https://github.com/nim-lang/Nim/issues/15428 (#15488)
This commit is contained in:
parent
1e28cea0d1
commit
4e438f9096
7 changed files with 94 additions and 47 deletions
|
|
@ -1195,7 +1195,8 @@ proc requestConstImpl(p: BProc, sym: PSym) =
|
|||
# add a suffix for hcr - will later init the global pointer with this data
|
||||
let actualConstName = if m.hcrOn: sym.loc.r & "_const" else: sym.loc.r
|
||||
q.s[cfsData].addf("N_LIB_PRIVATE NIM_CONST $1 $2 = $3;$n",
|
||||
[getTypeDesc(q, sym.typ), actualConstName, genBracedInit(q.initProc, sym.ast, isConst = true)])
|
||||
[getTypeDesc(q, sym.typ), actualConstName,
|
||||
genBracedInit(q.initProc, sym.ast, isConst = true, sym.typ)])
|
||||
if m.hcrOn:
|
||||
# generate the global pointer with the real name
|
||||
q.s[cfsVars].addf("static $1* $2;$n", [getTypeDesc(m, sym.loc.t, skVar), sym.loc.r])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue