| author | |
| committer | |
| log | 7b44e8986fa0a8121993ab328b129789127a13bd |
| tree | 283543b2691a1cc62d0c79a762cd3a68fd892faf |
| parent | 106850fd4cc218f77d5b37738095c7afd7d7b74b |
| signature |
Because this syntax is not heavily used, and the migration can be done
with a simple text substitution, I do not believe a `zig fmt` fixup is
necessary for this change.
Resolves: https://github.com/ziglang/zig/issues/152132 files changed, 7 insertions(+), 1 deletions(-)
src/Sema.zig-1| ... | ... | @@ -18339,7 +18339,6 @@ fn zirStructInitEmpty(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileE |
| 18339 | 18339 | switch (obj_ty.zigTypeTag(zcu)) { |
| 18340 | 18340 | .@"struct" => return sema.structInitEmpty(block, obj_ty, src, src), |
| 18341 | 18341 | .array, .vector => return sema.arrayInitEmpty(block, src, obj_ty), |
| 18342 | .void => return Air.internedToRef(Value.void.toIntern()), | |
| 18343 | 18342 | .@"union" => return sema.fail(block, src, "union initializer must initialize one field", .{}), |
| 18344 | 18343 | else => return sema.failWithArrayInitNotSupported(block, src, obj_ty), |
| 18345 | 18344 | } |
test/cases/compile_errors/bad_void_initializer.zig created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | comptime { | |
| 2 | _ = void{}; | |
| 3 | } | |
| 4 | ||
| 5 | // error | |
| 6 | // | |
| 7 | // :2:13: error: type 'void' does not support array initialization syntax |