| ... | @@ -9597,6 +9597,12 @@ void copy_const_val(CodeGen *g, ZigValue *dest, ZigValue *src) { | ... | @@ -9597,6 +9597,12 @@ void copy_const_val(CodeGen *g, ZigValue *dest, ZigValue *src) { |
| 9597 | break; | 9597 | break; |
| 9598 | } | 9598 | } |
| 9599 | } | 9599 | } |
| | 9600 | } else if (dest->type->id == ZigTypeIdUnion) { |
| | 9601 | bigint_init_bigint(&dest->data.x_union.tag, &src->data.x_union.tag); |
| | 9602 | dest->data.x_union.payload = g->pass1_arena->create<ZigValue>(); |
| | 9603 | copy_const_val(g, dest->data.x_union.payload, src->data.x_union.payload); |
| | 9604 | dest->data.x_union.payload->parent.id = ConstParentIdUnion; |
| | 9605 | dest->data.x_union.payload->parent.data.p_union.union_val = dest; |
| 9600 | } else if (type_has_optional_repr(dest->type) && dest->data.x_optional != nullptr) { | 9606 | } else if (type_has_optional_repr(dest->type) && dest->data.x_optional != nullptr) { |
| 9601 | dest->data.x_optional = g->pass1_arena->create<ZigValue>(); | 9607 | dest->data.x_optional = g->pass1_arena->create<ZigValue>(); |
| 9602 | copy_const_val(g, dest->data.x_optional, src->data.x_optional); | 9608 | copy_const_val(g, dest->data.x_optional, src->data.x_optional); |