'return' for first class iterators

This commit is contained in:
Araq 2012-11-26 08:47:57 +01:00
commit 2591ac0ada
6 changed files with 80 additions and 21 deletions

View file

@ -792,7 +792,8 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
if n.sons[genericParamsPos].kind == nkEmpty:
ParamsTypeCheck(c, s.typ)
pushProcCon(c, s)
if s.typ.sons[0] != nil and kind != skIterator:
if s.typ.sons[0] != nil and
(kind != skIterator or s.typ.callConv == ccClosure):
addResult(c, s.typ.sons[0], n.info, kind)
addResultNode(c, n)
if sfImportc notin s.flags: