Browse Source

Make `!x` be an untyped boolean

gingerBill 2 years ago
parent
commit
b0f0a02d3c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/check_expr.cpp

+ 2 - 0
src/check_expr.cpp

@@ -1688,6 +1688,8 @@ gb_internal bool check_unary_op(CheckerContext *c, Operand *o, Token op) {
 			if (is_type_integer(type)) {
 				error_line("\tSuggestion: Did you mean to use the bitwise not operator '~'?\n");
 			}
+		} else {
+			o->type = t_untyped_bool;
 		}
 		break;