From 090e30f07b10a79edf38736cc466a4f223167971 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 22 Feb 2023 11:48:10 +0000 Subject: Make `-verbose-errors` the default; `-terse-errors` to disable it --- src/check_expr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/check_expr.cpp') 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; -- cgit v1.2.3