# Sema: rewrite peer type resolution · gitcafe/zig

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

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

Visibility: public

Requested revision: c9531eb833e1e2c432dc2bfb0ca3b25622b7001e

Requested commit: c9531eb833e1e2c432dc2bfb0ca3b25622b7001e

Commit: c9531eb833e1e2c432dc2bfb0ca3b25622b7001e

Tree: 7cdae51f8762b670aed003b3654ff429a731146d

Author: mlugg

Committer: mlugg

## Message

```
Sema: rewrite peer type resolution

The existing logic for peer type resolution was quite convoluted and
buggy. This rewrite makes it much more resilient, readable, and
extensible. The algorithm works by first iterating over the types to
select a "strategy", then applying that strategy, possibly applying peer
resolution recursively.

Several new tests have been added to cover cases which the old logic did
not correctly handle.

Resolves: #15138
Resolves: #15644
Resolves: #15693
Resolves: #15709
Resolves: #15752

```

## Parents

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

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