Merge pull request #6605 from odin-lang/bill/array-cast

Native Array Casting Semantics
This commit is contained in:
gingerBill
2026-04-28 11:07:31 +01:00
committed by GitHub
3 changed files with 307 additions and 27 deletions

View File

@@ -3460,8 +3460,13 @@ gb_internal bool check_is_castable_to(CheckerContext *c, Operand *operand, Type
if (dst->kind == Type_Array && src->kind == Type_Array) {
if (are_types_identical(dst->Array.elem, src->Array.elem)) {
return dst->Array.count == src->Array.count;
if (dst->Array.count == src->Array.count) {
if (are_types_identical(dst->Array.elem, src->Array.elem)) {
return true;
}
Operand op = *operand;
op.type = src->Array.elem;
return check_is_castable_to(c, &op, dst->Array.elem);
}
}