| ... | ... | @@ -3340,7 +3340,9 @@ fn validateStructInit( |
| 3340 | 3340 | const struct_ptr = try sema.resolveInst(struct_ptr_zir_ref); |
| 3341 | 3341 | const struct_ty = sema.typeOf(struct_ptr).childType(); |
| 3342 | 3342 | |
| 3343 | | if (is_comptime or block.is_comptime) { |
| 3343 | if ((is_comptime or block.is_comptime) and |
| 3344 | (try sema.resolveDefinedValue(block, init_src, struct_ptr)) != null) |
| 3345 | { |
| 3344 | 3346 | // In this case the only thing we need to do is evaluate the implicit |
| 3345 | 3347 | // store instructions for default field values, and report any missing fields. |
| 3346 | 3348 | // Avoid the cost of the extra machinery for detecting a comptime struct init value. |
| ... | ... | @@ -3544,7 +3546,9 @@ fn zirValidateArrayInit( |
| 3544 | 3546 | }); |
| 3545 | 3547 | } |
| 3546 | 3548 | |
| 3547 | | if (is_comptime or block.is_comptime) { |
| 3549 | if ((is_comptime or block.is_comptime) and |
| 3550 | (try sema.resolveDefinedValue(block, init_src, array_ptr)) != null) |
| 3551 | { |
| 3548 | 3552 | // In this case the comptime machinery will have evaluated the store instructions |
| 3549 | 3553 | // at comptime so we have almost nothing to do here. However, in case of a |
| 3550 | 3554 | // sentinel-terminated array, the sentinel will not have been populated by |