mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: clean up assign_stmt() (#17664)
This commit is contained in:
parent
88ab947440
commit
45c0a21f46
@ -82,14 +82,14 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
||||
} else if right_first is ast.ParExpr {
|
||||
mut right_next := right_first
|
||||
for {
|
||||
if right_next.expr is ast.CallExpr {
|
||||
if (right_next.expr as ast.CallExpr).return_type == ast.void_type {
|
||||
c.error('assignment mismatch: expected ${node.left.len} value(s) but `${(right_next.expr as ast.CallExpr).name}()` returns ${right_len} value(s)',
|
||||
if mut right_next.expr is ast.CallExpr {
|
||||
if right_next.expr.return_type == ast.void_type {
|
||||
c.error('assignment mismatch: expected ${node.left.len} value(s) but `${right_next.expr.name}()` returns ${right_len} value(s)',
|
||||
node.pos)
|
||||
}
|
||||
break
|
||||
} else if right_next.expr is ast.ParExpr {
|
||||
right_next = right_next.expr as ast.ParExpr
|
||||
} else if mut right_next.expr is ast.ParExpr {
|
||||
right_next = right_next.expr
|
||||
} else {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user