| ... | @@ -4149,6 +4149,13 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com | ... | @@ -4149,6 +4149,13 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com |
| 4149 | return; | 4149 | return; |
| 4150 | } | 4150 | } |
| 4151 | | 4151 | |
| | 4152 | if (try sema.typeRequiresComptime(final_elem_ty)) { |
| | 4153 | // The alloc wasn't comptime-known per the above logic, so the |
| | 4154 | // type cannot be comptime-only. |
| | 4155 | // TODO: source location of runtime control flow |
| | 4156 | return sema.fail(block, src, "value with comptime-only type '{}' depends on runtime control flow", .{final_elem_ty.fmt(mod)}); |
| | 4157 | } |
| | 4158 | |
| 4152 | try sema.queueFullTypeResolution(final_elem_ty); | 4159 | try sema.queueFullTypeResolution(final_elem_ty); |
| 4153 | | 4160 | |
| 4154 | // Change it to a normal alloc. | 4161 | // Change it to a normal alloc. |