# AstGen: pre-scan all decls in a namespace · gitcafe/zig

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

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

Visibility: public

Requested revision: 4bb5d17edc85eac74626224810d6a44a3c73cca3

Requested commit: 4bb5d17edc85eac74626224810d6a44a3c73cca3

Commit: 4bb5d17edc85eac74626224810d6a44a3c73cca3

Tree: 1464b91474019c5c047ba66bae7197fa7e6d73bf

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: pre-scan all decls in a namespace

Also:
 * improve the "ambiguous reference" error by swapping the order of
   "declared here" and "also declared here" notes.
 * improve the "not accessible from inner function" error:
   - point out that it has to do with the thing being mutable
   - eliminate the incorrect association with it being a function
   - note where it crosses a namespace boundary
 * struct field types are evaluated in a context that has the struct
   namespace visible. Likewise with align expressions, linksection
   expressions, enum tag values, and union/enum tag argument
   expressions.

Closes #9194
Closes #9622

```

## Parents

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

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