From d4984e069adc1984c2f67d073ebb7c42873c4d08 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 17 Jul 2020 15:24:36 +0200 Subject: arc: cursors for simple for loop variables (#15008) * arc: cursors for simple for loop variables * merged devel --- compiler/transf.nim | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'compiler/transf.nim') diff --git a/compiler/transf.nim b/compiler/transf.nim index be559abb8..7aa18bf52 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -350,7 +350,7 @@ proc transformYield(c: PTransf, n: PNode): PNode = # Choose the right assignment instruction according to the given ``lhs`` # node since it may not be a nkSym (a stack-allocated skForVar) but a # nkDotExpr (a heap-allocated slot into the envP block) - case lhs.kind: + case lhs.kind of nkSym: internalAssert c.graph.config, lhs.sym.kind == skForVar result = newAsgnStmt(c, nkFastAsgn, lhs, rhs) @@ -592,6 +592,22 @@ proc findWrongOwners(c: PTransf, n: PNode) = else: for i in 0..