# AstGen: migrate \`ty\` result locations to \`coerced_ty\` · gitcafe/zig

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

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

Visibility: public

Requested revision: 10784c7fc8d419fff943994f1aa5a454d4e43391

Requested commit: 10784c7fc8d419fff943994f1aa5a454d4e43391

Commit: 10784c7fc8d419fff943994f1aa5a454d4e43391

Tree: f58674fe9b481693abbba790f95491e950681ef8

Author: mlugg

Committer: mlugg

## Message

```
AstGen: migrate `ty` result locations to `coerced_ty`

In most cases where AstGen is coercing to a fixed type (such as `u29`,
`type`, `std.builtin.CallingConvention) we do not necessarily require an
explicit coercion instruction. Instead, Sema knows the type that is
required, and can perform the coercion after the fact. This means we can
use the `coerced_ty` result location kind, saving unnecessary coercion
instructions and therefore ZIR bytes.

This required a few enhancements to Sema to introduce missing coercions.

```

## Parents

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

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