comptime load of vector element

This commit is contained in:
Andrew Kelley 2019-11-01 18:19:25 -04:00
parent 55e54d98c4
commit ece8d6c2fa
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 2 additions and 2 deletions

View File

@ -17744,7 +17744,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct
zig_panic("TODO elem ptr on a slice has a null pointer"); zig_panic("TODO elem ptr on a slice has a null pointer");
} }
return result; return result;
} else if (array_type->id == ZigTypeIdArray) { } else if (array_type->id == ZigTypeIdArray || array_type->id == ZigTypeIdVector) {
IrInstruction *result; IrInstruction *result;
if (orig_array_ptr_val->data.x_ptr.mut == ConstPtrMutInfer) { if (orig_array_ptr_val->data.x_ptr.mut == ConstPtrMutInfer) {
result = ir_build_elem_ptr(&ira->new_irb, elem_ptr_instruction->base.scope, result = ir_build_elem_ptr(&ira->new_irb, elem_ptr_instruction->base.scope,

View File

@ -174,5 +174,5 @@ test "load vector elements via comptime index" {
}; };
S.doTheTest(); S.doTheTest();
//comptime S.doTheTest(); comptime S.doTheTest();
} }