mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Add shadow suggestion
This commit is contained in:
+5
-1
@@ -565,7 +565,11 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O
|
|||||||
} else {
|
} else {
|
||||||
error(lhs->expr, "Cannot assign to '%s' which is a procedure parameter", str);
|
error(lhs->expr, "Cannot assign to '%s' which is a procedure parameter", str);
|
||||||
}
|
}
|
||||||
error_line("\tSuggestion: Did you mean to pass '%.*s' by pointer?\n", LIT(e->token.string));
|
if (is_type_pointer(e->type)) {
|
||||||
|
error_line("\tSuggestion: Did you mean to shadow it? '%.*s := %.*s'?\n", LIT(e->token.string), LIT(e->token.string));
|
||||||
|
} else {
|
||||||
|
error_line("\tSuggestion: Did you mean to pass '%.*s' by pointer?\n", LIT(e->token.string));
|
||||||
|
}
|
||||||
show_error_on_line(e->token.pos, token_pos_end(e->token));
|
show_error_on_line(e->token.pos, token_pos_end(e->token));
|
||||||
} else {
|
} else {
|
||||||
ERROR_BLOCK();
|
ERROR_BLOCK();
|
||||||
|
|||||||
Reference in New Issue
Block a user