# AstGen: add compile error for decl name conflicts · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8344a50e1c545bbeb63debc90cb91289be53b689)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8344a50e1c545bbeb63debc90cb91289be53b689

Requested commit: 8344a50e1c545bbeb63debc90cb91289be53b689

Commit: 8344a50e1c545bbeb63debc90cb91289be53b689

Tree: 83df1936d65e78c1369acc544b2d261c2127ecf4

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: add compile error for decl name conflicts

 * Remove the ability for GenZir parent Scope to be null. Now there is a
   Top Scope at the top.
 * Introduce Scope.Namespace to contain a table of decl names in order
   to emit a compile error for name conflicts.
 * Fix use of invalid memory when reporting compile errors by
   duplicating decl names into a temporary heap allocated buffer.
 * Fix memory leak in while and for loops, not cleaning up their
   labeled_breaks and store_to_block_ptr_list arrays.
 * Fix stage2 test cases because now the source location of redundant
   comptime keyword compile errors is improved.
 * Implement compile error for local variable shadowing declaration.

```

## Parents

- [93896ef860da734cbb1247e796c0d14706b1c235](https://git.cafe/gitcafe/zig/commit/93896ef860da734cbb1247e796c0d14706b1c235?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8344a50e1c545bbeb63debc90cb91289be53b689?format=markdown)
