types API: now works for proc():void

This commit is contained in:
Araq 2015-02-24 01:57:49 +01:00
commit 7324ed7f1f

View file

@ -51,6 +51,10 @@ proc mapTypeToBracket(name: string; t: PType; info: TLineInfo): PNode =
result = newNodeIT(nkBracketExpr, info, t) result = newNodeIT(nkBracketExpr, info, t)
result.add atomicTypeX(name, t, info) result.add atomicTypeX(name, t, info)
for i in 0 .. < t.len: for i in 0 .. < t.len:
if t.sons[i] == nil:
let void = atomicTypeX("void", t, info)
void.typ = newType(tyEmpty, t.owner)
else:
result.add mapTypeToAst(t.sons[i], info) result.add mapTypeToAst(t.sons[i], info)
proc mapTypeToAst(t: PType, info: TLineInfo; allowRecursion=false): PNode = proc mapTypeToAst(t: PType, info: TLineInfo; allowRecursion=false): PNode =