# improve stage2 to allow catch at comptime: · gitcafe/zig

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

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

Visibility: public

Requested revision: 153c97ac9ec8deafb0777ae424f00695c18e3bd9

Requested commit: 153c97ac9ec8deafb0777ae424f00695c18e3bd9

Commit: 153c97ac9ec8deafb0777ae424f00695c18e3bd9

Tree: 4bc0b2c23e2d4844252efd98f453a2100043b14f

Author: g-w1

Committer: Andrew Kelley

## Message

```
improve stage2 to allow catch at comptime:

* add error_union value tag.
* add analyzeIsErr
* add Value.isError
* add TZIR wrap_errunion_payload and wrap_errunion_err for
  wrapping from T -> E!T and E -> E!T
* add anlyzeInstUnwrapErrCode and analyzeInstUnwrapErr
* add analyzeInstEnsureErrPayloadVoid:
* add wrapErrorUnion
* add comptime error comparison for tests
* tests!

```

## Parents

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

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