# Sema: rework peer type logic for pointers · gitcafe/zig

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

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

Visibility: public

Requested revision: 63c5c510b1a083fbbca4145b1b53d39da9b0fd81

Requested commit: 63c5c510b1a083fbbca4145b1b53d39da9b0fd81

Commit: 63c5c510b1a083fbbca4145b1b53d39da9b0fd81

Tree: fc00c36767b6c15a444ec5c57f69778517ac740b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: rework peer type logic for pointers

Now it's centered around a switch on the chosen type tag which gives us
easy access to pointer data.

The logic is simplied and in some cases logic is removed when it is
sufficient to choose the type that is a better coercion target without
knowing whether such coercion will succeed ahead of time.

A bug is fixed at the bottom of the function; we were doing the opposite
of what we were supposed to with `seen_const`.

Also the bottom of the function has a more complete handling of the
possible combinations of `any_are_null`, `convert_to_slice`, and
`err_set_ty`.

In the behavior tests, not as many backends needed to be skipped.

```

## Parents

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

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