# fix incorrect union const value generation · gitcafe/zig

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

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

Visibility: public

Requested revision: dd1338b0e6280b10b9b62ca73bf9ece34bd8524e

Requested commit: dd1338b0e6280b10b9b62ca73bf9ece34bd8524e

Commit: dd1338b0e6280b10b9b62ca73bf9ece34bd8524e

Tree: e9745fe1b7a469cf8859b820c7a73715d76832d1

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fix incorrect union const value generation

closes #1381

The union was generated as a 3 byte struct when it needed to be
4 bytes so that the packed struct bitcast could work correctly.

Now it recognizes this situation and adds padding bytes to become
the correct size so that it can fit into an array.

```

## Parents

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

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