allow void as a field type

This commit is contained in:
Zahary Karadjov 2013-05-25 20:46:50 +03:00
commit aea27a7ce4
2 changed files with 42 additions and 26 deletions

View file

@ -437,8 +437,9 @@ proc genRecordFieldsAux(m: BModule, n: PNode,
app(result, genRecordFieldsAux(m, k, ae, rectype, check))
else: internalError("genRecordFieldsAux(record case branch)")
appf(result, "} $1;$n", [uname])
of nkSym:
of nkSym:
field = n.sym
if field.typ.kind == tyEmpty: return
#assert(field.ast == nil)
sname = mangleRecFieldName(field, rectype)
if accessExpr != nil: ae = ropef("$1.$2", [accessExpr, sname])