# Support equality comparison for optional to non-optional \(?T ==/\!= T\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 51682717d773aa4bdee89bc67cab08dc9b4bcc15

Requested commit: 51682717d773aa4bdee89bc67cab08dc9b4bcc15

Commit: 51682717d773aa4bdee89bc67cab08dc9b4bcc15

Tree: ae6222e43438e2fbc936fab72deb9a340d0f3ba3

Author: foobles

Committer: Andrew Kelley

## Message

```
Support equality comparison for optional to non-optional (?T ==/!= T)

extracted function ir_try_evaluate_bin_op_const
extracted type_is_self_comparable function
renamed ir_try_evaluate_bin_op_const to ir_try_evaluate_bin_op_cmp_const
implemented analysis of ?T == T
added ir_set_cursor_at_end_and_append_basic_block_gen
use build_br_gen and ir_set_cursor_at_end_and_append_block_gen
added ir_append_basic_block_gen
removed include of all_types in ir.cpp
extracted compile-time and runtime evaluation of cmp_optional_non_optional to separate functions

closes #5390
closes #1332

```

## Parents

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

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