* fix #16110 * refs #16110 * fix comment * Trigger build * use shallowCopy for efficiency
This commit is contained in:
parent
8c12d3e29d
commit
2f1a9eadd7
2 changed files with 32 additions and 8 deletions
|
|
@ -1278,8 +1278,17 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
|
|||
incl st.flags, tfRefsAnonObj
|
||||
let obj = newSym(skType, getIdent(c.cache, s.name.s & ":ObjectType"),
|
||||
nextId c.idgen, getCurrOwner(c), s.info)
|
||||
obj.ast = a.copyTree
|
||||
obj.ast[0] = newSymNode(obj)
|
||||
let symNode = newSymNode(obj)
|
||||
obj.ast = a.shallowCopy
|
||||
case a[0].kind
|
||||
of nkSym: obj.ast[0] = symNode
|
||||
of nkPragmaExpr:
|
||||
obj.ast[0] = a[0].shallowCopy
|
||||
obj.ast[0][0] = symNode
|
||||
obj.ast[0][1] = a[0][1]
|
||||
else: assert(false)
|
||||
obj.ast[1] = a[1]
|
||||
obj.ast[2] = a[2][0]
|
||||
if sfPure in s.flags:
|
||||
obj.flags.incl sfPure
|
||||
obj.typ = st.lastSon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue