gingerBill 1 year ago
parent
commit
06ff08b9cf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/llvm_backend_expr.cpp

+ 2 - 1
src/llvm_backend_expr.cpp

@@ -3283,7 +3283,8 @@ gb_internal lbValue lb_build_expr_internal(lbProcedure *p, Ast *expr) {
 	Type *type = type_of_expr(expr);
 	Type *type = type_of_expr(expr);
 	GB_ASSERT_MSG(tv.mode != Addressing_Invalid, "invalid expression '%s' (tv.mode = %d, tv.type = %s) @ %s\n Current Proc: %.*s : %s", expr_to_string(expr), tv.mode, type_to_string(tv.type), token_pos_to_string(expr_pos), LIT(p->name), type_to_string(p->type));
 	GB_ASSERT_MSG(tv.mode != Addressing_Invalid, "invalid expression '%s' (tv.mode = %d, tv.type = %s) @ %s\n Current Proc: %.*s : %s", expr_to_string(expr), tv.mode, type_to_string(tv.type), token_pos_to_string(expr_pos), LIT(p->name), type_to_string(p->type));
 
 
-	if (tv.value.kind != ExactValue_Invalid) {
+
+	if (tv.value.kind != ExactValue_Invalid && !is_type_union(type)) {
 		// NOTE(bill): The commented out code below is just for debug purposes only
 		// NOTE(bill): The commented out code below is just for debug purposes only
 		// if (is_type_untyped(type)) {
 		// if (is_type_untyped(type)) {
 		// 	gb_printf_err("%s %s : %s @ %p\n", token_pos_to_string(expr_pos), expr_to_string(expr), type_to_string(expr->tav.type), expr);
 		// 	gb_printf_err("%s %s : %s @ %p\n", token_pos_to_string(expr_pos), expr_to_string(expr), type_to_string(expr->tav.type), expr);