diff options
| author | xenobas <rahimos.123@gmail.com> | 2025-08-08 14:40:43 +0100 |
|---|---|---|
| committer | xenobas <rahimos.123@gmail.com> | 2025-08-08 14:40:43 +0100 |
| commit | 443dd566e39721d3e5321212fcfc418d7a7d43fe (patch) | |
| tree | a5474c50fd7b98f0076f13b7708f404d1b7a2b5f /src/check_expr.cpp | |
| parent | 843c39189ef8fb4a65a787643314015b641009d6 (diff) | |
Add a better suggestion for cases that don't need ^ operator
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index aa9c8837d..f314ce3cd 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2455,7 +2455,8 @@ gb_internal void check_assignment_error_suggestion(CheckerContext *c, Operand *o } else if (is_type_pointer(o->type) && are_types_identical(type_deref(o->type), type)) { gbString s = expr_to_string(o->expr); - error_line("\tSuggestion: Did you mean `%s^`\n", s); + if (s[0] == '&') error_line("\tSuggestion: Did you mean `%s`\n", &s[1]); + else error_line("\tSuggestion: Did you mean `%s^`\n", s); gb_string_free(s); } } |