diff options
-rw-r--r-- | compiler/semstmts.nim | 2 | ||||
-rw-r--r-- | compiler/varpartitions.nim | 2 | ||||
-rw-r--r-- | lib/pure/sugar.nim | 10 |
3 files changed, 12 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 68f0cee64..1315e8960 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -159,7 +159,7 @@ proc semIf(c: PContext, n: PNode; flags: TExprFlags): PNode = if it.len == 2: openScope(c) it[0] = forceBool(c, semExprWithType(c, it[0])) - it[1] = semExprBranch(c, it[1]) + it[1] = semExprBranch(c, it[1], flags) typ = commonType(typ, it[1]) closeScope(c) elif it.len == 1: diff --git a/compiler/varpartitions.nim b/compiler/varpartitions.nim index 4535c9aac..6857e1b57 100644 --- a/compiler/varpartitions.nim +++ b/compiler/varpartitions.nim @@ -11,7 +11,7 @@ ## Nim's write tracking and also for the cursor inference. ## The algorithm is a reinvention / variation of Steensgaard's ## algorithm. -## The used algorithm is "union find" with path compression. +## The used data structure is "union find" with path compression. import ast, types, lineinfos, options, msgs, renderer from trees import getMagic diff --git a/lib/pure/sugar.nim b/lib/pure/sugar.nim index d2bdb0fdc..00f4de5d8 100644 --- a/lib/pure/sugar.nim +++ b/lib/pure/sugar.nim @@ -394,3 +394,13 @@ when isMainModule: of "bird": "word" else: d assert z == @["word", "word"] + + + proc tforum = + let ans = collect(newSeq): + for y in 0..10: + if y mod 5 == 2: + for x in 0..y: + x + + tforum() |