aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-02-22 11:48:10 +0000
committergingerBill <bill@gingerbill.org>2023-02-22 11:48:10 +0000
commit090e30f07b10a79edf38736cc466a4f223167971 (patch)
treece4c3957789661066ef0acee1ca01a0ef1a79f84 /src/check_expr.cpp
parentf5d507a9b9d20941bd86ba8559f710f21f0c8ccd (diff)
Make `-verbose-errors` the default; `-terse-errors` to disable it
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index d7e7b29a4..f42483c86 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -1679,9 +1679,13 @@ gb_internal bool check_unary_op(CheckerContext *c, Operand *o, Token op) {
case Token_Not:
if (!is_type_boolean(type)) {
+ ERROR_BLOCK();
str = expr_to_string(o->expr);
- error(op, "Operator '%.*s' is only allowed on boolean expression", LIT(op.string));
+ error(op, "Operator '%.*s' is only allowed on boolean expressions", LIT(op.string));
gb_string_free(str);
+ if (is_type_integer(type)) {
+ error_line("\tSuggestion: Did you mean to use the bitwise not operator '~'?\n");
+ }
}
break;