revert new scope for 'if'
This commit is contained in:
parent
c75aa98706
commit
1dd01e5891
8 changed files with 182 additions and 6 deletions
|
|
@ -1504,8 +1504,9 @@ proc semIf(c: PContext, n: PNode): PNode =
|
|||
for i in countup(0, sonsLen(n) - 1):
|
||||
var it = n.sons[i]
|
||||
if it.len == 2:
|
||||
openScope(c.tab)
|
||||
when newScopeForIf: openScope(c.tab)
|
||||
it.sons[0] = forceBool(c, semExprWithType(c, it.sons[0]))
|
||||
when not newScopeForIf: openScope(c.tab)
|
||||
it.sons[1] = semExprBranch(c, it.sons[1])
|
||||
typ = commonType(typ, it.sons[1].typ)
|
||||
closeScope(c.tab)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue