# local consts with comptime init exprs · gitcafe/zig

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

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

Visibility: public

Requested revision: 3702c278e3b2073bdf7aadb8bcdf1cd4156bec28

Requested commit: 3702c278e3b2073bdf7aadb8bcdf1cd4156bec28

Commit: 3702c278e3b2073bdf7aadb8bcdf1cd4156bec28

Tree: 9099b3bee74226ccaa846747b12d6a17179ec473

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

````
local consts with comptime init exprs

```zig
export fn entry() void {
    const x = if (true) u8(4) else u32(8);
}
```

```llvm
define void @entry() #2 !dbg !35 {
Entry:
  call void @llvm.dbg.declare(metadata i8* @0, metadata !39, metadata !DIExpression()), !dbg !41
  ret void, !dbg !42
}
```

````

## Parents

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

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