void object fields are now ignored by codegen and fields/fieldPairs iterator (#10144)
* Codegen now ignores object fields of type void * Fix `$` bug for objects/tuples where it does not add a comma * fields/fieldPairs iterators now ignore void types * Use `isEmptyType` instead of checking for `tyVoid` directly
This commit is contained in:
parent
6389271d1c
commit
d998cb58dd
5 changed files with 25 additions and 0 deletions
|
|
@ -1502,6 +1502,8 @@ proc createRecordVarAux(p: PProc, rec: PNode, excludedFieldIDs: IntSet, output:
|
|||
for i in countup(1, sonsLen(rec) - 1):
|
||||
createRecordVarAux(p, lastSon(rec.sons[i]), excludedFieldIDs, output)
|
||||
of nkSym:
|
||||
# Do not produce code for void types
|
||||
if isEmptyType(rec.sym.typ): return
|
||||
if rec.sym.id notin excludedFieldIDs:
|
||||
if output.len > 0: output.add(", ")
|
||||
output.addf("$#: ", [mangleName(p.module, rec.sym)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue