diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-24 16:23:33 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-24 16:23:33 -0400 |
| commit | 32c89531b1475ce8e3b8efdf7a07745da7bc854a (patch) | |
| tree | 848ea8ac81eabbe6293eacdfc16210b1d6973a99 /src/ir.cpp | |
| parent | 345042ecbc7fb645fd17b69df4e57ffefa5be5a5 (diff) | |
| download | zig-32c89531b1475ce8e3b8efdf7a07745da7bc854a.tar.gz zig-32c89531b1475ce8e3b8efdf7a07745da7bc854a.zip | |
Add missing compile error when ptr used instead of array
in array literals.
Fixes #3524
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 8aff5e4583..3b3814b3ad 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17590,7 +17590,10 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct false); array_ptr_val->data.x_struct.fields[slice_ptr_index].data.x_ptr.mut = ConstPtrMutInfer; } else { - zig_unreachable(); + ir_add_error(ira, elem_ptr_instruction->init_array_type, + buf_sprintf("expected array type or [_], found '%s'", + buf_ptr(&array_type->name))); + return ira->codegen->invalid_instruction; } } |
