diff options
Diffstat (limited to 'compiler/semfields.nim')
-rw-r--r-- | compiler/semfields.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/semfields.nim b/compiler/semfields.nim index 93184c568..36e3b57e7 100644 --- a/compiler/semfields.nim +++ b/compiler/semfields.nim @@ -133,6 +133,8 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = typeMismatch(c.config, calli.info, tupleTypeA, tupleTypeB, calli) inc(c.p.nestedLoopCounter) + let oldBreakInLoop = c.p.breakInLoop + c.p.breakInLoop = true if tupleTypeA.kind == tyTuple: var loopBody = n[^1] for i in 0..<tupleTypeA.len: @@ -156,6 +158,7 @@ proc semForFields(c: PContext, n: PNode, m: TMagic): PNode = semForObjectFields(fc, t.n, n, stmts) if t[0] == nil: break t = skipTypes(t[0], skipPtrs) + c.p.breakInLoop = oldBreakInLoop dec(c.p.nestedLoopCounter) # for TR macros this 'while true: ...; break' loop is pretty bad, so # we avoid it now if we can: |