further steps for closure support
This commit is contained in:
parent
161f6f7229
commit
2c4a1dbc0c
7 changed files with 101 additions and 57 deletions
|
|
@ -92,7 +92,8 @@ proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
|
|||
# if a proc accesses a global variable, it is not side effect free:
|
||||
if sfGlobal in s.flags:
|
||||
incl(c.p.owner.flags, sfSideEffect)
|
||||
elif s.owner != c.p.owner and s.owner.kind != skModule:
|
||||
elif s.owner != c.p.owner and s.owner.kind != skModule 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:
|
||||
# Currently captures are restricted to a single level of nesting:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue