next steps for closure consistency; fixes #176

This commit is contained in:
Araq 2012-07-25 21:59:31 +02:00
commit 20b6dc3829
9 changed files with 495 additions and 9 deletions

View file

@ -108,7 +108,7 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
incl(c.p.owner.flags, sfSideEffect)
elif s.kind == skParam and s.typ.kind == tyExpr:
return s.typ.n
elif s.owner != c.p.owner and s.owner.kind != skModule and
elif s.owner != c.p.owner and
c.p.owner.typ != nil and not IsGenericRoutine(s.owner):
c.p.owner.typ.callConv = ccClosure
if illegalCapture(s) or c.p.next.owner != s.owner: