An unnamed break in a block now gives an UnnamedBreak warning (#20901)
* unnamed break in the block now gives an error * bootstrap * fixes * more fixes * break with label * label again * one moee * Delete test5.txt * it now gives a UnnamedBreak warning * change the URL of bump back to the original one
This commit is contained in:
parent
d149727f34
commit
ef29987781
16 changed files with 85 additions and 20 deletions
|
|
@ -1457,6 +1457,8 @@ proc semStmtListType(c: PContext, n: PNode, prev: PType): PType =
|
|||
|
||||
proc semBlockType(c: PContext, n: PNode, prev: PType): PType =
|
||||
inc(c.p.nestedBlockCounter)
|
||||
let oldBreakInLoop = c.p.breakInLoop
|
||||
c.p.breakInLoop = false
|
||||
checkSonsLen(n, 2, c.config)
|
||||
openScope(c)
|
||||
if n[0].kind notin {nkEmpty, nkSym}:
|
||||
|
|
@ -1465,6 +1467,7 @@ proc semBlockType(c: PContext, n: PNode, prev: PType): PType =
|
|||
n[1].typ = result
|
||||
n.typ = result
|
||||
closeScope(c)
|
||||
c.p.breakInLoop = oldBreakInLoop
|
||||
dec(c.p.nestedBlockCounter)
|
||||
|
||||
proc semGenericParamInInvocation(c: PContext, n: PNode): PType =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue