diff options
| author | gingerBill <bill@gingerbill.org> | 2024-03-20 13:36:14 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-03-20 13:36:14 +0000 |
| commit | ba77a9464c7e912dda52dd512dc98f3c241581ac (patch) | |
| tree | eb3149e4eaff504acc18e391e8e697469d4c9ba0 /src/check_expr.cpp | |
| parent | b1dae2d59ab1f35992d0f24b4f01d4d2123f9262 (diff) | |
Add suggestion for `x: ^T; y = x` to be `x^`
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index e22d57814..8fb2cf36b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2254,6 +2254,11 @@ gb_internal void check_assignment_error_suggestion(CheckerContext *c, Operand *o gbString s = expr_to_string(o->expr); error_line("\tSuggestion: Did you mean `&%s`\n", s); gb_string_free(s); + } 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); + gb_string_free(s); } } |