# langref: Add test case for "if error union with optional" · gitcafe/zig

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

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

Visibility: public

Requested revision: f77c968cf841046238eb37f54600cda201f09ce2

Requested commit: f77c968cf841046238eb37f54600cda201f09ce2

Commit: f77c968cf841046238eb37f54600cda201f09ce2

Tree: 49221c678e9037ec5f305ebac52dcf3c64e069f5

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
langref: Add test case for "if error union with optional"

This is an edge case that isn't too uncommon but is rather confusing to try to deduce without documentation, since it feels like `else` is being overloaded in this scenario and there's no obvious 'correct' behavior here. This just adds a test demonstrating how Zig currently behaves in this scenario.

```

## Parents

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

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