diff options
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 730c52c927..2775c05b79 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -5158,11 +5158,10 @@ bool const_values_equal(CodeGen *g, ConstExprValue *a, ConstExprValue *b) { if (bigint_cmp(&union1->tag, &union2->tag) == CmpEQ) { TypeUnionField *field = find_union_field_by_tag(a->type, &union1->tag); assert(field != nullptr); - if (type_has_bits(field->type_entry)) { - zig_panic("TODO const expr analyze union field value for equality"); - } else { + if (!type_has_bits(field->type_entry)) return true; - } + assert(find_union_field_by_tag(a->type, &union2->tag) != nullptr); + return const_values_equal(g, union1->payload, union2->payload); } return false; } |
