| ... | @@ -151,3 +151,15 @@ test "result location with inferred type ends up being pointer to comptime_int" | ... | @@ -151,3 +151,15 @@ test "result location with inferred type ends up being pointer to comptime_int" |
| 151 | } else @as(u32, 0); | 151 | } else @as(u32, 0); |
| 152 | try expect(c == 1); | 152 | try expect(c == 1); |
| 153 | } | 153 | } |
| | 154 | |
| | 155 | test "if-@as-if chain" { |
| | 156 | var fast = true; |
| | 157 | var very_fast = false; |
| | 158 | |
| | 159 | const num_frames = if (fast) |
| | 160 | @as(u32, if (very_fast) 16 else 4) |
| | 161 | else |
| | 162 | 1; |
| | 163 | |
| | 164 | try expect(num_frames == 4); |
| | 165 | } |