# Sema: move all in-memory coercion logic to InternPool · gitcafe/zig

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

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

Visibility: public

Requested revision: 8a92beb088c5eb890f0b662ca6e0c8d68b72fd6a

Requested commit: 8a92beb088c5eb890f0b662ca6e0c8d68b72fd6a

Commit: 8a92beb088c5eb890f0b662ca6e0c8d68b72fd6a

Tree: 3acb3639945161008da3092313ed8a7eb107315e

Author: mlugg

Committer: mlugg

## Message

```
Sema: move all in-memory coercion logic to InternPool

Previously, this logic was split between Sema.coerceValueInMemory and
InternPool.getCoerced. This led to issues when trying to coerce e.g. an
optional containing an aggregate, because we'd call through to
InternPool's version which only recurses on itself so could not coerce
aggregates. Unifying them is fairly simple, and also simplified a bit of
logic in Sema.

Also fixes a key lifetime bug in aggregate coercion.

```

## Parents

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

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