1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: run vfmt over checker.v

This commit is contained in:
Delyan Angelov 2020-09-27 17:08:11 +03:00
parent 7305b2c401
commit cfdf66c129

View File

@ -1130,7 +1130,8 @@ pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
call_expr.should_be_skipped = true call_expr.should_be_skipped = true
} }
nr_args := if method.params.len == 0 { 0 } else { method.params.len - 1 } nr_args := if method.params.len == 0 { 0 } else { method.params.len - 1 }
min_required_args := method.params.len - if method.is_variadic && method.params.len > 1 { 2 } else { 1 } min_required_args := method.params.len - if method.is_variadic && method.params.len >
1 { 2 } else { 1 }
if call_expr.args.len < min_required_args { if call_expr.args.len < min_required_args {
c.error('too few arguments in call to `${left_type_sym.source_name}.$method_name` ($call_expr.args.len instead of $min_required_args)', c.error('too few arguments in call to `${left_type_sym.source_name}.$method_name` ($call_expr.args.len instead of $min_required_args)',
call_expr.pos) call_expr.pos)
@ -3223,7 +3224,7 @@ pub fn (mut c Checker) select_expr(mut node ast.SelectExpr) table.Type {
} }
pub fn (mut c Checker) lock_expr(mut node ast.LockExpr) table.Type { pub fn (mut c Checker) lock_expr(mut node ast.LockExpr) table.Type {
for i in 0..node.lockeds.len { for i in 0 .. node.lockeds.len {
c.ident(mut node.lockeds[i]) c.ident(mut node.lockeds[i])
id := node.lockeds[i] id := node.lockeds[i]
if id.obj is ast.Var as v { if id.obj is ast.Var as v {