mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-24 22:54:59 -07:00
Improve error messages with 'using _'
This commit is contained in:
+5
-1
@@ -584,7 +584,11 @@ void check_label(CheckerContext *ctx, Ast *label, Ast *parent) {
|
||||
// Returns 'true' for 'continue', 'false' for 'return'
|
||||
bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us, Ast *expr, bool is_selector, Entity *e) {
|
||||
if (e == nullptr) {
|
||||
error(us->token, "'using' applied to an unknown entity");
|
||||
if (is_blank_ident(expr)) {
|
||||
error(us->token, "'using' in a statement is not allowed with the blank identifier '_'");
|
||||
} else {
|
||||
error(us->token, "'using' applied to an unknown entity");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user