| ... | @@ -5458,8 +5458,19 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) { | ... | @@ -5458,8 +5458,19 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) { |
| 5458 | case TypeTableEntryIdPointer: | 5458 | case TypeTableEntryIdPointer: |
| 5459 | case TypeTableEntryIdFn: | 5459 | case TypeTableEntryIdFn: |
| 5460 | return const_values_equal_ptr(a, b); | 5460 | return const_values_equal_ptr(a, b); |
| 5461 | case TypeTableEntryIdArray: | 5461 | case TypeTableEntryIdArray: { |
| 5462 | zig_panic("TODO"); | 5462 | assert(a->type->data.array.len == b->type->data.array.len); |
| | 5463 | size_t len = a->type->data.array.len; |
| | 5464 | ConstExprValue *a_elems = a->data.x_array.s_none.elements; |
| | 5465 | ConstExprValue *b_elems = b->data.x_array.s_none.elements; |
| | 5466 | |
| | 5467 | for (size_t i = 0; i < len; ++i) { |
| | 5468 | if (!const_values_equal(&a_elems[i], &b_elems[i])) |
| | 5469 | return false; |
| | 5470 | } |
| | 5471 | |
| | 5472 | return true; |
| | 5473 | } |
| 5463 | case TypeTableEntryIdStruct: | 5474 | case TypeTableEntryIdStruct: |
| 5464 | for (size_t i = 0; i < a->type->data.structure.src_field_count; i += 1) { | 5475 | for (size_t i = 0; i < a->type->data.structure.src_field_count; i += 1) { |
| 5465 | ConstExprValue *field_a = &a->data.x_struct.fields[i]; | 5476 | ConstExprValue *field_a = &a->data.x_struct.fields[i]; |