fixes #3788
This commit is contained in:
parent
a2db3c24d1
commit
5a33e8795e
1 changed files with 5 additions and 3 deletions
|
|
@ -1101,6 +1101,7 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||||
|
|
||||||
if n[namePos].kind == nkEmpty:
|
if n[namePos].kind == nkEmpty:
|
||||||
s = newSym(kind, idAnon, getCurrOwner(), n.info)
|
s = newSym(kind, idAnon, getCurrOwner(), n.info)
|
||||||
|
incl(s.flags, sfUsed)
|
||||||
isAnon = true
|
isAnon = true
|
||||||
else:
|
else:
|
||||||
s = semIdentDef(c, n.sons[0], kind)
|
s = semIdentDef(c, n.sons[0], kind)
|
||||||
|
|
@ -1153,9 +1154,10 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||||
s.typ.flags.incl(tfIterator)
|
s.typ.flags.incl(tfIterator)
|
||||||
|
|
||||||
var proto = searchForProc(c, oldScope, s)
|
var proto = searchForProc(c, oldScope, s)
|
||||||
if proto == nil:
|
if proto == nil or isAnon:
|
||||||
if s.kind == skIterator and s.typ.callConv == ccClosure:
|
if s.kind == skIterator:
|
||||||
discard
|
if s.typ.callConv != ccClosure:
|
||||||
|
s.typ.callConv = if isAnon: ccClosure else: ccInline
|
||||||
else:
|
else:
|
||||||
s.typ.callConv = lastOptionEntry(c).defaultCC
|
s.typ.callConv = lastOptionEntry(c).defaultCC
|
||||||
# add it here, so that recursive procs are possible:
|
# add it here, so that recursive procs are possible:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue