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_expr.cpp | |
| parent | 551c379f1bc6fa81f36b0d054eb7a190a27e2c60 (diff) | |
Add separate `-vet` flags; `-vet-using-*` flags; `//+vet` file flags
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 98154f33d..fe389e027 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3099,7 +3099,7 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type) { update_untyped_expr_type(c, x->expr, final_type, true); } - if (build_context.vet_extra) { + if (check_vet_flags(c) & VetFlag_Extra) { if (are_types_identical(x->type, type)) { gbString str = type_to_string(type); warning(x->expr, "Unneeded cast to the same type '%s'", str); @@ -3171,7 +3171,7 @@ gb_internal bool check_transmute(CheckerContext *c, Ast *node, Operand *o, Type return false; } - if (build_context.vet_extra) { + if (check_vet_flags(c) & VetFlag_Extra) { if (are_types_identical(o->type, dst_t)) { gbString str = type_to_string(dst_t); warning(o->expr, "Unneeded transmute to the same type '%s'", str); @@ -10028,7 +10028,7 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast Type *type = type_of_expr(ac->expr); check_cast(c, o, type_hint); if (is_type_typed(type) && are_types_identical(type, type_hint)) { - if (build_context.vet_extra) { + if (check_vet_flags(c) & VetFlag_Extra) { error(node, "Redundant 'auto_cast' applied to expression"); } } |