Merge pull request #8108 from LemonBoy/fix-5958
Make `static` blocks introduce their own scope
This commit is contained in:
commit
ccb1514837
5 changed files with 23 additions and 15 deletions
|
|
@ -1779,7 +1779,9 @@ proc semStaticStmt(c: PContext, n: PNode): PNode =
|
|||
#echo "semStaticStmt"
|
||||
#writeStackTrace()
|
||||
inc c.inStaticContext
|
||||
openScope(c)
|
||||
let a = semStmt(c, n.sons[0])
|
||||
closeScope(c)
|
||||
dec c.inStaticContext
|
||||
n.sons[0] = a
|
||||
evalStaticStmt(c.module, c.graph, a, c.p.owner)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue