fixes most recent iterators-as-expressions regression

This commit is contained in:
Andreas Rumpf 2018-01-18 18:57:29 +01:00
commit 33b0e73962

View file

@ -1637,7 +1637,7 @@ proc semIterator(c: PContext, n: PNode): PNode =
# bug #7093: if after a macro transformation we don't have an # bug #7093: if after a macro transformation we don't have an
# nkIteratorDef aynmore, return. The iterator then might have been # nkIteratorDef aynmore, return. The iterator then might have been
# sem'checked already. (Or not, if the macro skips it.) # sem'checked already. (Or not, if the macro skips it.)
if result.kind != nkIteratorDef: return if result.kind != n.kind: return
var s = result.sons[namePos].sym var s = result.sons[namePos].sym
var t = s.typ var t = s.typ
if t.sons[0] == nil and s.typ.callConv != ccClosure: if t.sons[0] == nil and s.typ.callConv != ccClosure: