further steps for closure support

This commit is contained in:
Araq 2012-02-06 08:44:18 +01:00
commit 161f6f7229
8 changed files with 41 additions and 21 deletions

View file

@ -221,7 +221,8 @@ proc generateThunk(c: PTransf, prc: PNode, dest: PType): PNode =
## Converts 'prc' into '(thunk, nil)' so that it's compatible with
## a closure.
# XXX we hack around here by generating a 'cast' instead of a proper thunk.
# we cannot generate a proper thunk here for GC-safety reasons (see internal
# documentation):
result = newNodeIT(nkClosure, prc.info, dest)
var conv = newNodeIT(nkHiddenStdConv, prc.info, dest)
conv.add(emptyNode)