# if statements can be const expr evaluated · gitcafe/zig

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

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

Visibility: public

Requested revision: d8f6388b63b3c4abe235a5fe0a49e9b18f6fb2f5

Requested commit: d8f6388b63b3c4abe235a5fe0a49e9b18f6fb2f5

Commit: d8f6388b63b3c4abe235a5fe0a49e9b18f6fb2f5

Tree: 4ed6e6ba5a173ca66f5137af175d170966838e54

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
if statements can be const expr evaluated

also introduce error for unnecessary if statement
but if the condition depends on a compile variable, then
the if statement is OK

```

## Parents

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

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