diff options
| author | gingerBill <bill@gingerbill.org> | 2023-07-31 11:09:19 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-07-31 11:09:19 +0100 |
| commit | 60e509b1e066da14461b3832307065726e651153 (patch) | |
| tree | 24e90b4646dc7a70e24c00ab7154d6bcfc494fe5 /src/check_stmt.cpp | |
| parent | 551c379f1bc6fa81f36b0d054eb7a190a27e2c60 (diff) | |
Add separate `-vet` flags; `-vet-using-*` flags; `//+vet` file flags
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index a15977b7d..2c1ee8331 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -2464,6 +2464,12 @@ gb_internal void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) error(us->token, "Empty 'using' list"); return; } + if (check_vet_flags(ctx) & VetFlag_UsingStmt) { + ERROR_BLOCK(); + error(node, "'using' as a statement is now allowed when '-vet' or '-vet-using' is applied"); + error_line("\t'using' is considered bad practice to use as a statement outside of immediate refactoring\n"); + } + for (Ast *expr : us->list) { expr = unparen_expr(expr); Entity *e = nullptr; |