From 1ad5a070c4e998a3dd4aed00330169c9c0b052e0 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Thu, 2 Jan 2025 11:56:53 -0300 Subject: [PATCH] Update assign.v --- vlib/v/checker/assign.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/assign.v b/vlib/v/checker/assign.v index 52131f55491402..07f664219646c5 100644 --- a/vlib/v/checker/assign.v +++ b/vlib/v/checker/assign.v @@ -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) @@ -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.