Skip to content

Commit

Permalink
Update assign.v
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp authored Jan 2, 2025
1 parent 9ccb685 commit 1ad5a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/checker/assign.v
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
node.right_types = right_type_sym.mr_info().types
right_len = node.right_types.len
} else if right_type == ast.void_type {
right_len = 0
right_len = if c.inside_recheck { right_len } else { 0 }
if mut right is ast.IfExpr {
last_branch := right.branches.last()
last_stmts := last_branch.stmts.filter(it is ast.ExprStmt)
Expand Down Expand Up @@ -95,7 +95,7 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) {
}
}
}
if node.left.len != right_len {
if !c.inside_recheck && node.left.len != right_len {
if mut right_first is ast.CallExpr {
if node.left_types.len > 0 && node.left_types[0] == ast.void_type {
// If it's a void type, it's an unknown variable, already had an error earlier.
Expand Down

0 comments on commit 1ad5a07

Please sign in to comment.