fixes #12323 [backport]
This commit is contained in:
parent
9d000c519a
commit
a60f18d025
1 changed files with 3 additions and 1 deletions
|
|
@ -477,7 +477,7 @@ proc detectCapturedVars(n: PNode; owner: PSym; c: var DetectionPass) =
|
||||||
w = up
|
w = up
|
||||||
of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit,
|
of nkEmpty..pred(nkSym), succ(nkSym)..nkNilLit,
|
||||||
nkTemplateDef, nkTypeSection, nkProcDef, nkMethodDef,
|
nkTemplateDef, nkTypeSection, nkProcDef, nkMethodDef,
|
||||||
nkConverterDef, nkMacroDef, nkFuncDef, nkCommentStmt:
|
nkConverterDef, nkMacroDef, nkFuncDef, nkCommentStmt, nkTypeOfExpr:
|
||||||
discard
|
discard
|
||||||
of nkLambdaKinds, nkIteratorDef:
|
of nkLambdaKinds, nkIteratorDef:
|
||||||
if n.typ != nil:
|
if n.typ != nil:
|
||||||
|
|
@ -760,6 +760,8 @@ proc liftCapturedVars(n: PNode; owner: PSym; d: DetectionPass;
|
||||||
n[0].sons[1] = liftCapturedVars(n[0].sons[1], owner, d, c)
|
n[0].sons[1] = liftCapturedVars(n[0].sons[1], owner, d, c)
|
||||||
else:
|
else:
|
||||||
n.sons[0] = liftCapturedVars(n[0], owner, d, c)
|
n.sons[0] = liftCapturedVars(n[0], owner, d, c)
|
||||||
|
of nkTypeOfExpr:
|
||||||
|
result = n
|
||||||
else:
|
else:
|
||||||
if owner.isIterator:
|
if owner.isIterator:
|
||||||
if nfLL in n.flags:
|
if nfLL in n.flags:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue