fixes all known regressions
This commit is contained in:
parent
dfe01bbe69
commit
98cc99cbcf
3 changed files with 18 additions and 20 deletions
|
|
@ -751,12 +751,12 @@ proc liftLambdas*(fn: PSym, body: PNode; tooEarly: var bool): PNode =
|
|||
tooEarly = true
|
||||
else:
|
||||
var d = initDetectionPass(fn)
|
||||
var c = initLiftingPass(fn)
|
||||
detectCapturedVars(body, fn, d)
|
||||
if not d.somethingToDo and fn.isIterator:
|
||||
addClosureParam(d, fn)
|
||||
d.somethingToDo = true
|
||||
if d.somethingToDo:
|
||||
var c = initLiftingPass(fn)
|
||||
var newBody = liftCapturedVars(body, fn, d, c)
|
||||
if c.envvars.getOrDefault(fn.id) != nil:
|
||||
newBody = newTree(nkStmtList, rawClosureCreation(fn, d, c), newBody)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue