Skip to content

Commit

Permalink
Allow transmute(Bit_Set)~T(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Sep 11, 2024
1 parent 3b22c08 commit 27ed107
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/check_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3612,7 +3612,8 @@ gb_internal bool check_transmute(CheckerContext *c, Ast *node, Operand *o, Type
if (are_types_identical(src_bt, dst_bt)) {
return true;
}
if (is_type_integer(src_t) && is_type_integer(dst_t)) {
if ((is_type_integer(src_t) && is_type_integer(dst_t)) ||
is_type_integer(src_t) && is_type_bit_set(dst_t)) {
if (types_have_same_internal_endian(src_t, dst_t)) {
ExactValue src_v = exact_value_to_integer(o->value);
GB_ASSERT(src_v.kind == ExactValue_Integer || src_v.kind == ExactValue_Invalid);
Expand Down

0 comments on commit 27ed107

Please sign in to comment.