# Sema: const inferred alloc infers comptime-ness · gitcafe/zig

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

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

Visibility: public

Requested revision: 8c6175c1343a00278efc029a0be4091ff505dc3d

Requested commit: 8c6175c1343a00278efc029a0be4091ff505dc3d

Commit: 8c6175c1343a00278efc029a0be4091ff505dc3d

Tree: 63f9c87d0f37757f5c0c0b543fc94ea4fe68ae22

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: const inferred alloc infers comptime-ness

const locals now detect if the value ends up being comptime known. In
such case, it replaces the runtime AIR instructions with a decl_ref
const.

In the backends, some more sophisticated logic for marking decls as
alive was needed to prevent Decls incorrectly being garbage collected
that were indirectly referenced in such manner.

```

## Parents

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

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