# stage1: Don't fold single-element enums too aggressively · gitcafe/zig

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

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

Visibility: public

Requested revision: 97f36d93f4766a8d225d19665309e825cdef72bf

Requested commit: 97f36d93f4766a8d225d19665309e825cdef72bf

Commit: 97f36d93f4766a8d225d19665309e825cdef72bf

Tree: a2bf281da218754ddd558cbe0fc03d2e741ef145

Author: LemonBoy

Committer: LemonBoy

## Message

```
stage1: Don't fold single-element enums too aggressively

When the tag type is not a zero-sized type (eg. `enum(i32)`) we
absolutely need to avoid constant-folding this values. Doing so masked
any invalid input and, since the folding was not even applied
consistently, introduced some hard to catch errors.

```

## Parents

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

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