From 04d4431299d392fade2ec45a984dd60d4d43859f Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 13 Sep 2021 18:17:44 +0300 Subject: [PATCH] checker: remove another unnecessary error --- vlib/v/checker/checker.v | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 93765a1332..83e36986af 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -3899,8 +3899,11 @@ pub fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) { } if node.left.len != right_len { if right_first is ast.CallExpr { - c.error('assignment mismatch: $node.left.len variable(s) but `${right_first.name}()` returns $right_len value(s)', - node.pos) + 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. + c.error('assignment mismatch: $node.left.len variable(s) but `${right_first.name}()` returns $right_len value(s)', + node.pos) + } } else { c.error('assignment mismatch: $node.left.len variable(s) $right_len value(s)', node.pos)