Properly fix #3820

This commit is contained in:
gingerBill
2024-06-28 09:08:57 +01:00
parent 0c8a81d298
commit 5a9698e8cb
2 changed files with 52 additions and 16 deletions

View File

@@ -4431,9 +4431,14 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar
defer (gb_string_free(type_str));
if (valid_count == 1) {
Type *new_type = t->Union.variants[first_success_index];
target_type = new_type;
if (is_type_union(new_type)) {
convert_to_typed(c, operand, new_type);
break;
}
operand->type = new_type;
operand->mode = Addressing_Value;
operand->type = t->Union.variants[first_success_index];
target_type = t->Union.variants[first_success_index];
break;
} else if (valid_count > 1) {
ERROR_BLOCK();