We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b9e460 commit e26a182Copy full SHA for e26a182
src/nimony/controlflow.nim
@@ -299,10 +299,13 @@ proc trUseExpr(c: var ControlFlow; n: var Cursor) =
299
300
proc trStmtOrExpr(c: var ControlFlow; n: var Cursor; tar: var Target) =
301
if tar.m != IsIgnored:
302
+ var aa = Target(m: IsEmpty)
303
+ # it may be a `ExprX` so we generate statements before `AsgnS`
304
+ trExpr c, n, aa
305
c.dest.addParLe(AsgnS, n.info)
306
assert tar.t.len > 0
307
c.dest.add tar
- trUseExpr c, n
308
+ c.dest.add aa
309
c.dest.addParRi()
310
else:
311
trStmt c, n
tests/nimony/sysbasics/tconditionals.nim
@@ -0,0 +1,7 @@
1
+proc foo = discard
2
+
3
+var x = if true:
4
+ 1
5
+ else:
6
+ foo()
7
+ 2
0 commit comments