# declarations may collide with primitives with @"" syntax · gitcafe/zig

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

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

Visibility: public

Requested revision: f30aa25cbf9c9a415963b4ea69d7efa09237a704

Requested commit: f30aa25cbf9c9a415963b4ea69d7efa09237a704

Commit: f30aa25cbf9c9a415963b4ea69d7efa09237a704

Tree: f0150470b35bb7b55450c54dbb4553e3cc11b29f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
declarations may collide with primitives with @"" syntax

 * stage2 AstGen: add missing compile error for declaring a local
   that shadows a primitive. Even with `@""` syntax, it may not have
   the same name as a primitive.
 * stage2 AstGen: add a compile error for a global declaration
   whose name matches a primitive. However it is allowed when using
   `@""` syntax.
 * stage1: delete all "declaration shadows primitive" compile errors
   because they are now handled by stage2 AstGen.
 * stage1/stage2 AstGen: notice when using `@""` syntax and:
   - treat `_` as a regular identifier
   - skip checking if an identifire is a primitive

Check the new test cases for clarifications on semantics.

closes #6062

```

## Parents

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

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