mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 11:22:22 -07: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;
|
||||
}
|
||||
|
||||
if (o->mode == Addressing_Constant) {
|
||||
gbString expr_str = expr_to_string(o->expr);
|
||||
error(o->expr, "Cannot transmute a constant expression: '%s'", expr_str);
|
||||
gb_string_free(expr_str);
|
||||
o->mode = Addressing_Invalid;
|
||||
o->expr = node;
|
||||
return false;
|
||||
}
|
||||
// if (o->mode == Addressing_Constant) {
|
||||
// gbString expr_str = expr_to_string(o->expr);
|
||||
// error(o->expr, "Cannot transmute a constant expression: '%s'", expr_str);
|
||||
// gb_string_free(expr_str);
|
||||
// o->mode = Addressing_Invalid;
|
||||
// o->expr = node;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (is_type_untyped(o->type)) {
|
||||
gbString expr_str = expr_to_string(o->expr);
|
||||
|
||||
Reference in New Issue
Block a user