# stage2: apply type coercion in if expressions · gitcafe/zig

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

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

Visibility: public

Requested revision: fd1284ebd07ded1c67bbaff4c14f093051e56f59

Requested commit: fd1284ebd07ded1c67bbaff4c14f093051e56f59

Commit: fd1284ebd07ded1c67bbaff4c14f093051e56f59

Tree: 3ceb66a3288aae5aa8495ff00e7af89c9561f134

Author: John Schmidt

Committer: Andrew Kelley

## Message

```
stage2: apply type coercion in if expressions

When setting the break value in an if expression we must explicitly
check if a result location type coercion that needs to happen. This was
already done for switch expression, so let's just imitate that check
and fix for if expressions. To make this possible, we now also propagate
`rl_ty_inst` to sub scopes.

```

## Parents

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

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