1
0
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:
yuyi 2023-03-18 04:43:38 +08:00 committed by GitHub
parent 88ab947440
commit 45c0a21f46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}