aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
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;
}
}