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:
@@ -82,14 +82,14 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
|
|||||||
} else if right_first is ast.ParExpr {
|
} else if right_first is ast.ParExpr {
|
||||||
mut right_next := right_first
|
mut right_next := right_first
|
||||||
for {
|
for {
|
||||||
if right_next.expr is ast.CallExpr {
|
if mut right_next.expr is ast.CallExpr {
|
||||||
if (right_next.expr as ast.CallExpr).return_type == ast.void_type {
|
if right_next.expr.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)',
|
c.error('assignment mismatch: expected ${node.left.len} value(s) but `${right_next.expr.name}()` returns ${right_len} value(s)',
|
||||||
node.pos)
|
node.pos)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
} else if right_next.expr is ast.ParExpr {
|
} else if mut right_next.expr is ast.ParExpr {
|
||||||
right_next = right_next.expr as ast.ParExpr
|
right_next = right_next.expr
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user