aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-23 11:33:52 +0100
committergingerBill <bill@gingerbill.org>2022-05-23 11:33:52 +0100
commit438713af2037511208b52545fd43a6155c017b34 (patch)
treec36deff830034184f4c46495f689abff866d2bb9 /src/check_expr.cpp
parent5609221831e79d91c58d9efe3e6dcdde473b07ae (diff)
Allow `transmute` on constant expressions
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index f578f8c73..bc28583b7 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -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);