zig/test/behavior
Andrew Kelley 7f41e20802 AstGen: emit as instructions for branching expressions
There is a mechanism to avoid redundant `as` ZIR instructions which is
to pass `ResultLoc.coerced_ty` instead of `ResultLoc.ty` when it is
known by AstGen that Sema will do the coercion.

This commit downgrades `coerced_ty` to `ty` when a result location
passes through an expression that branches, such as `if`, `switch`,
`while`, and `for`, causing the `as` ZIR instruction to be emitted.

This ensures that the type of a result location will be applied to, e.g.
a `comptime_int` on either side of a branch on a runtime condition.
2022-01-15 23:13:44 -07:00
..
2021-10-26 16:43:18 -07:00
2021-10-28 17:33:05 -07:00
2022-01-10 21:01:00 +01:00
2022-01-10 21:01:00 +01:00
2021-08-30 18:50:07 -04:00
2022-01-08 14:30:11 -05:00
2022-01-08 14:30:11 -05:00
2021-11-22 03:21:31 +01:00
2021-11-27 00:27:52 -07:00
2021-11-27 00:27:52 -07:00
2022-01-07 00:06:06 -05:00
2022-01-07 00:06:06 -05:00
2021-11-27 00:27:52 -07:00
2021-11-26 23:17:01 -07:00
2022-01-07 00:06:06 -05:00
2021-07-26 20:05:48 -04:00
2022-01-08 14:01:28 +01:00
2021-12-28 23:22:09 -07:00
2021-12-28 23:22:09 -07:00
2022-01-03 02:09:54 +01:00
2022-01-03 02:09:54 +01:00
2022-01-03 02:09:54 +01:00
2021-11-27 00:27:52 -07:00
2021-12-28 23:22:09 -07:00
2021-12-27 15:30:31 -07:00
2022-01-07 00:06:06 -05:00