mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-11 02:19:30 +00:00
Merge pull request #6921 from tf2spi/6757-array-programming-cast
Allow casts to change mode for array programming
This commit is contained in:
@@ -3934,6 +3934,11 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type, bool forb
|
||||
}
|
||||
}
|
||||
|
||||
// In this case, the cast involves array programming
|
||||
// so the operand needs to be a computed value
|
||||
if (!is_type_array_like(x->type) && is_type_array_like(type)) {
|
||||
x->mode = Addressing_Value;
|
||||
}
|
||||
x->type = type;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user