Merge pull request #8108 from LemonBoy/fix-5958

Make `static` blocks introduce their own scope
This commit is contained in:
Andreas Rumpf 2018-06-26 23:16:40 +02:00 • committed by GitHub
commit ccb1514837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 15 deletions

View file

@ -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)