mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Allow transmute on constant expressions
This commit is contained in:
+8
-8
@@ -2786,14 +2786,14 @@ bool check_transmute(CheckerContext *c, Ast *node, Operand *o, Type *t) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o->mode == Addressing_Constant) {
|
// if (o->mode == Addressing_Constant) {
|
||||||
gbString expr_str = expr_to_string(o->expr);
|
// gbString expr_str = expr_to_string(o->expr);
|
||||||
error(o->expr, "Cannot transmute a constant expression: '%s'", expr_str);
|
// error(o->expr, "Cannot transmute a constant expression: '%s'", expr_str);
|
||||||
gb_string_free(expr_str);
|
// gb_string_free(expr_str);
|
||||||
o->mode = Addressing_Invalid;
|
// o->mode = Addressing_Invalid;
|
||||||
o->expr = node;
|
// o->expr = node;
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (is_type_untyped(o->type)) {
|
if (is_type_untyped(o->type)) {
|
||||||
gbString expr_str = expr_to_string(o->expr);
|
gbString expr_str = expr_to_string(o->expr);
|
||||||
|
|||||||
Reference in New Issue
Block a user