# CBE: handle returning \`undefined\` for ErrorUnion · gitcafe/zig

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

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

Visibility: public

Requested revision: d127c1d59ebf19e5ffaedece99a39f69712683b0

Requested commit: d127c1d59ebf19e5ffaedece99a39f69712683b0

Commit: d127c1d59ebf19e5ffaedece99a39f69712683b0

Tree: a0eeee42fefce1fba094ab8ce6851452aba561ac

Author: Daniele Cocca

Committer: Andrew Kelley

## Message

```
CBE: handle returning `undefined` for ErrorUnion

Just like for Struct in 8238d4b33585a715c58ab559cd001dd3ea1db55b, in the
case of ErrorUnion struct we need to return a compound literal "(T){...}"
instead of just "{}", which is invalid code when used in e.g. a "return"
expression.

```

## Parents

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

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