Skip to content

Commit 0896290

Browse files
committed
checker: relax the redundant () check to a notice, to enable a future v -W test vlib/builtin job on the CI
1 parent 967a4a2 commit 0896290

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎vlib/v/checker/checker.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,7 @@ pub fn (mut c Checker) expr(mut node ast.Expr) ast.Type {
33533353
// }
33543354
ast.ParExpr {
33553355
if node.expr is ast.ParExpr {
3356-
c.warn('redundant parentheses are used', node.pos)
3356+
c.note('redundant parentheses are used', node.pos)
33573357
}
33583358
return c.expr(mut node.expr)
33593359
}

‎vlib/v/checker/tests/assign_immutable_reference_var_with_parenthesis_err.out‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
vlib/v/checker/tests/assign_immutable_reference_var_with_parenthesis_err.vv:11:12: warning: redundant parentheses are used
1+
vlib/v/checker/tests/assign_immutable_reference_var_with_parenthesis_err.vv:11:12: notice: redundant parentheses are used
22
9 | fn foo() {
33
10 | mut a := &(a_char)
44
11 | mut b := &((a_char))
55
| ~~~~~~~~~~
66
12 | mut c := &((((a_char))))
77
13 | println(a)
8-
vlib/v/checker/tests/assign_immutable_reference_var_with_parenthesis_err.vv:12:12: warning: redundant parentheses are used
8+
vlib/v/checker/tests/assign_immutable_reference_var_with_parenthesis_err.vv:12:12: notice: redundant parentheses are used
99
10 | mut a := &(a_char)
1010
11 | mut b := &((a_char))
1111
12 | mut c := &((((a_char))))

‎vlib/v/checker/tests/par_expr_assign_void_right_type_err.out‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vlib/v/checker/tests/par_expr_assign_void_right_type_err.vv:1:6: warning: redundant parentheses are used
1+
vlib/v/checker/tests/par_expr_assign_void_right_type_err.vv:1:6: notice: redundant parentheses are used
22
1 | _ := ((((print(10)))))
33
| ~~~~~~~~~~~~~~~~~
44
vlib/v/checker/tests/par_expr_assign_void_right_type_err.vv:1:3: error: assignment mismatch: expected 1 value(s) but `print()` returns 0 value(s)

‎vlib/v/checker/tests/redundant_parentheses_warning.out‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vlib/v/checker/tests/redundant_parentheses_warning.vv:3:7: warning: redundant parentheses are used
1+
vlib/v/checker/tests/redundant_parentheses_warning.vv:3:7: notice: redundant parentheses are used
22
1 | fn main() {
33
2 | a := 2
44
3 | b := ((a + 2))

0 commit comments

Comments
 (0)