# wasm: implement \`struct_field_val\` for packed unions · gitcafe/zig

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

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

Visibility: public

Requested revision: 7cfc44d86ff56fd760eaf0781cc3ba0650267af9

Requested commit: 7cfc44d86ff56fd760eaf0781cc3ba0650267af9

Commit: 7cfc44d86ff56fd760eaf0781cc3ba0650267af9

Tree: 7bd69cbf461ec375c5ffbc1c79cb99d039fe5f2f

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: implement `struct_field_val` for packed unions

We currently have `isRef` return true for any type of union, including
packed unions. This means we can simply load it from the data section
to the exact type we want. In the future we can optimize it so it works
similarly to packed structs below 64 bits which do not get stored in
the data section and are not passed by ref.

```

## Parents

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

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