diff options
| author | Lucas Perlind <perlindluca@gmail.com> | 2022-10-14 18:22:59 +1100 |
|---|---|---|
| committer | Lucas Perlind <perlindluca@gmail.com> | 2022-10-15 19:46:17 +1100 |
| commit | 73c1f08776688f18940abcbff5d5b9f0f594049d (patch) | |
| tree | 31952326511194fbf7edbe1b4e0aac87985f4e7f /src/check_stmt.cpp | |
| parent | 874c1f076d5375f4fb898b050a64d90d47059360 (diff) | |
Improve error messages with 'using _'
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 630182273..9cacb4a35 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -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; } |