From 39f419139e7799a8bf6c1e1abf57954fa06cf694 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 1 Jul 2024 15:07:07 +0300 Subject: [PATCH] encoding.binary: add an f32 test; checker: remove "(s)" from the assignment mismatch error --- vlib/encoding/binary/little_endian.v | 4 +++- vlib/encoding/binary/little_endian_test.v | 9 +++++++++ vlib/v/checker/assign.v | 8 ++++++-- .../checker/tests/ambiguous_field_method_err.out | 2 +- vlib/v/checker/tests/append_err.out | 2 +- vlib/v/checker/tests/assign_multi_mismatch.out | 14 +++++++------- .../tests/assign_with_dump_multireturn_value.out | 2 +- vlib/v/checker/tests/filter_on_non_arr_err.out | 2 +- .../tests/func_with_static_keyword_err.out | 2 +- vlib/v/checker/tests/if_match_result.out | 8 ++++---- vlib/v/checker/tests/invalid_property.out | 6 +++--- vlib/v/checker/tests/invalid_variable_err.out | 2 +- .../enum_from_string_in_different_mods.out | 16 ++++++++-------- vlib/v/checker/tests/os_prefix.out | 2 +- .../tests/static_method_multi_return_err.out | 2 +- .../tests/static_method_not_found_err.out | 2 +- .../tests/top_level_fn_builtin_decl_err.out | 2 +- .../tests/unknown_method_suggest_name.out | 2 +- vlib/v/checker/tests/void_fn_as_value.out | 2 +- .../tests/void_function_assign_to_string.out | 2 +- 20 files changed, 53 insertions(+), 38 deletions(-) diff --git a/vlib/encoding/binary/little_endian.v b/vlib/encoding/binary/little_endian.v index a12823bac..8aa0f745c 100644 --- a/vlib/encoding/binary/little_endian.v +++ b/vlib/encoding/binary/little_endian.v @@ -157,5 +157,7 @@ pub fn little_endian_f32_at(b []u8, o int) f32 { _ = b[o] // bounds check _ = b[o + 3] // bounds check u := u32(b[o]) | (u32(b[o + 1]) << u32(8)) | (u32(b[o + 2]) << u32(16)) | (u32(b[o + 3]) << u32(24)) - return *(&f32(&u)) + unsafe { + return *(&f32(&u)) + } } diff --git a/vlib/encoding/binary/little_endian_test.v b/vlib/encoding/binary/little_endian_test.v index 195cd01b1..6ed87a2ab 100644 --- a/vlib/encoding/binary/little_endian_test.v +++ b/vlib/encoding/binary/little_endian_test.v @@ -140,6 +140,15 @@ fn test_little_endian_u64_at() { 0, 0, 0, 0], 1) != u64(0xf8a29e217f9f8e8f) } +fn test_little_endian_f32_at() { + assert little_endian_f32_at([u8(1), 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], + 1) == f32(0) + /* + assert little_endian_f32_at([u8(0), 5, 4, 9, 1, 7, 3, 6, 8, 0, 0, 0, 0, 0, 0, 0], + 1).eq_epsilon(0.00000000000000000000000000000000002516) + */ +} + fn test_little_endian_u64_end() { assert little_endian_u64_end([u8(1), 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]) == u64(0) assert little_endian_u64_end([u8(0), 0, 0, 0, 0, 0, 0, 0, 5, 4, 9, 1, 7, 3, 6, 8]) == u64(0x0806030701090405) diff --git a/vlib/v/checker/assign.v b/vlib/v/checker/assign.v index eb4c7347d..a9547347e 100644 --- a/vlib/v/checker/assign.v +++ b/vlib/v/checker/assign.v @@ -87,7 +87,9 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) { // If it's a void type, it's an unknown variable, already had an error earlier. return } - c.error('assignment mismatch: ${node.left.len} variable(s) but `${right_first.get_name()}()` returns ${right_len} value(s)', + str_variables := if node.left.len == 1 { 'variable' } else { 'variables' } + str_values := if right_len == 1 { 'value' } else { 'values' } + c.error('assignment mismatch: ${node.left.len} ${str_variables} but `${right_first.get_name()}()` returns ${right_len} ${str_values}', node.pos) } else if mut right_first is ast.ParExpr { mut right_next := right_first @@ -105,7 +107,9 @@ fn (mut c Checker) assign_stmt(mut node ast.AssignStmt) { } } } else { - c.error('assignment mismatch: ${node.left.len} variable(s) ${right_len} value(s)', + str_variables := if node.left.len == 1 { 'variable' } else { 'variables' } + str_values := if right_len == 1 { 'value' } else { 'values' } + c.error('assignment mismatch: ${node.left.len} ${str_variables} ${right_len} ${str_values}', node.pos) } return diff --git a/vlib/v/checker/tests/ambiguous_field_method_err.out b/vlib/v/checker/tests/ambiguous_field_method_err.out index 9360bb6b9..02c20aba6 100644 --- a/vlib/v/checker/tests/ambiguous_field_method_err.out +++ b/vlib/v/checker/tests/ambiguous_field_method_err.out @@ -31,7 +31,7 @@ vlib/v/checker/tests/ambiguous_field_method_err.vv:23:9: error: type `Bar` has n 23 | n := b.name | ~~~~ 24 | } -vlib/v/checker/tests/ambiguous_field_method_err.vv:23:4: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/ambiguous_field_method_err.vv:23:4: error: assignment mismatch: 1 variable 0 values 21 | b := Bar{} 22 | b.test() 23 | n := b.name diff --git a/vlib/v/checker/tests/append_err.out b/vlib/v/checker/tests/append_err.out index faabf2cbc..4ef3dfdb0 100644 --- a/vlib/v/checker/tests/append_err.out +++ b/vlib/v/checker/tests/append_err.out @@ -24,7 +24,7 @@ vlib/v/checker/tests/append_err.vv:6:15: error: `(l << 3)` does not return a val 6 | _ = (l << 3).len | ~~~ 7 | } -vlib/v/checker/tests/append_err.vv:6:4: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/append_err.vv:6:4: error: assignment mismatch: 1 variable 0 values 4 | 5 | _ = l << 3 6 | _ = (l << 3).len diff --git a/vlib/v/checker/tests/assign_multi_mismatch.out b/vlib/v/checker/tests/assign_multi_mismatch.out index dfea5a258..ab078c0d0 100644 --- a/vlib/v/checker/tests/assign_multi_mismatch.out +++ b/vlib/v/checker/tests/assign_multi_mismatch.out @@ -1,11 +1,11 @@ -vlib/v/checker/tests/assign_multi_mismatch.vv:5:3: error: assignment mismatch: 1 variable(s) 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:5:3: error: assignment mismatch: 1 variable 2 values 3 | } 4 | 5 | _ := 0, 0 | ~~ 6 | _ := f() 7 | _, _ := f() -vlib/v/checker/tests/assign_multi_mismatch.vv:6:3: error: assignment mismatch: 1 variable(s) but `f()` returns 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:6:3: error: assignment mismatch: 1 variable but `f()` returns 2 values 4 | 5 | _ := 0, 0 6 | _ := f() @@ -33,7 +33,7 @@ vlib/v/checker/tests/assign_multi_mismatch.vv:10:15: error: cannot use multi-val | ~~~ 11 | _, _, _ := f(), 0 12 | _, _ := f(), f() -vlib/v/checker/tests/assign_multi_mismatch.vv:10:9: error: assignment mismatch: 3 variable(s) 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:10:9: error: assignment mismatch: 3 variables 2 values 8 | _, _ := 0, f() 9 | _, _ := f(), 0 10 | _, _, _ := 0, f() @@ -47,7 +47,7 @@ vlib/v/checker/tests/assign_multi_mismatch.vv:11:12: error: cannot use multi-val | ~~~ 12 | _, _ := f(), f() 13 | _, _, _, _ := f(), f() -vlib/v/checker/tests/assign_multi_mismatch.vv:11:9: error: assignment mismatch: 3 variable(s) but `f()` returns 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:11:9: error: assignment mismatch: 3 variables but `f()` returns 2 values 9 | _, _ := f(), 0 10 | _, _, _ := 0, f() 11 | _, _, _ := f(), 0 @@ -68,14 +68,14 @@ vlib/v/checker/tests/assign_multi_mismatch.vv:13:15: error: cannot use multi-val | ~~~ 14 | 15 | _, _ := 0, match 4 { -vlib/v/checker/tests/assign_multi_mismatch.vv:13:12: error: assignment mismatch: 4 variable(s) but `f()` returns 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:13:12: error: assignment mismatch: 4 variables but `f()` returns 2 values 11 | _, _, _ := f(), 0 12 | _, _ := f(), f() 13 | _, _, _, _ := f(), f() | ~~ 14 | 15 | _, _ := 0, match 4 { -vlib/v/checker/tests/assign_multi_mismatch.vv:19:3: error: assignment mismatch: 1 variable(s) 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:19:3: error: assignment mismatch: 1 variable 2 values 17 | else { 1 } 18 | } 19 | _ := match 4 { @@ -89,7 +89,7 @@ vlib/v/checker/tests/assign_multi_mismatch.vv:23:12: error: cannot use multi-val | ~~~~~~~~~ 24 | 1 { f() } 25 | else { f() } -vlib/v/checker/tests/assign_multi_mismatch.vv:29:3: error: assignment mismatch: 1 variable(s) 2 value(s) +vlib/v/checker/tests/assign_multi_mismatch.vv:29:3: error: assignment mismatch: 1 variable 2 values 27 | 28 | _, _ := 0, if true { 0 } else { 1 } 29 | _ := if true { f() } else { f() } diff --git a/vlib/v/checker/tests/assign_with_dump_multireturn_value.out b/vlib/v/checker/tests/assign_with_dump_multireturn_value.out index 88dd6c238..86c03d549 100644 --- a/vlib/v/checker/tests/assign_with_dump_multireturn_value.out +++ b/vlib/v/checker/tests/assign_with_dump_multireturn_value.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/assign_with_dump_multireturn_value.vv:5:3: error: assignment mismatch: 1 variable(s) 2 value(s) +vlib/v/checker/tests/assign_with_dump_multireturn_value.vv:5:3: error: assignment mismatch: 1 variable 2 values 3 | } 4 | 5 | x := dump(two_returns()) diff --git a/vlib/v/checker/tests/filter_on_non_arr_err.out b/vlib/v/checker/tests/filter_on_non_arr_err.out index b3b298da3..06ed9536f 100644 --- a/vlib/v/checker/tests/filter_on_non_arr_err.out +++ b/vlib/v/checker/tests/filter_on_non_arr_err.out @@ -3,7 +3,7 @@ vlib/v/checker/tests/filter_on_non_arr_err.vv:2:14: error: unknown method or fie 2 | _ := 'test'.filter(it == `t`) | ~~~~~~~~~~~~~~~~~ 3 | } -vlib/v/checker/tests/filter_on_non_arr_err.vv:2:4: error: assignment mismatch: 1 variable(s) but `filter()` returns 0 value(s) +vlib/v/checker/tests/filter_on_non_arr_err.vv:2:4: error: assignment mismatch: 1 variable but `filter()` returns 0 values 1 | fn main() { 2 | _ := 'test'.filter(it == `t`) | ~~ diff --git a/vlib/v/checker/tests/func_with_static_keyword_err.out b/vlib/v/checker/tests/func_with_static_keyword_err.out index ab97f52de..ffc1869a8 100644 --- a/vlib/v/checker/tests/func_with_static_keyword_err.out +++ b/vlib/v/checker/tests/func_with_static_keyword_err.out @@ -4,7 +4,7 @@ vlib/v/checker/tests/func_with_static_keyword_err.vv:6:2: warning: unused variab 6 | a := a__static__b() | ^ 7 | } -vlib/v/checker/tests/func_with_static_keyword_err.vv:6:4: error: assignment mismatch: 1 variable(s) but `a__static__b()` returns 2 value(s) +vlib/v/checker/tests/func_with_static_keyword_err.vv:6:4: error: assignment mismatch: 1 variable but `a__static__b()` returns 2 values 4 | 5 | fn main() { 6 | a := a__static__b() diff --git a/vlib/v/checker/tests/if_match_result.out b/vlib/v/checker/tests/if_match_result.out index d9950d425..e0e0f4961 100644 --- a/vlib/v/checker/tests/if_match_result.out +++ b/vlib/v/checker/tests/if_match_result.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/if_match_result.vv:2:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/if_match_result.vv:2:3: error: assignment mismatch: 1 variable 0 values 1 | // missing results 2 | _ = match 4 { | ^ @@ -18,14 +18,14 @@ vlib/v/checker/tests/if_match_result.vv:7:3: error: `if` expression requires an | ~~~~ 8 | } 9 | -vlib/v/checker/tests/if_match_result.vv:6:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/if_match_result.vv:6:3: error: assignment mismatch: 1 variable 0 values 4 | else {} 5 | } 6 | _ = if true { | ^ 7 | } else { 8 | } -vlib/v/checker/tests/if_match_result.vv:11:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/if_match_result.vv:11:3: error: assignment mismatch: 1 variable 0 values 9 | 10 | // void results 11 | _ = match 4 { @@ -39,7 +39,7 @@ vlib/v/checker/tests/if_match_result.vv:16:2: error: the final expression in `if | ~~~~~~~~~~~ 17 | } else { 18 | exit(0) -vlib/v/checker/tests/if_match_result.vv:15:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/if_match_result.vv:15:3: error: assignment mismatch: 1 variable 0 values 13 | else { exit(0) } 14 | } 15 | _ = if true { diff --git a/vlib/v/checker/tests/invalid_property.out b/vlib/v/checker/tests/invalid_property.out index 127e9ef4d..2f15db5f1 100644 --- a/vlib/v/checker/tests/invalid_property.out +++ b/vlib/v/checker/tests/invalid_property.out @@ -4,7 +4,7 @@ vlib/v/checker/tests/invalid_property.vv:2:7: error: `string` has no property `l | ~~~~~~ 3 | _ = [1,2].foo 4 | -vlib/v/checker/tests/invalid_property.vv:2:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/invalid_property.vv:2:3: error: assignment mismatch: 1 variable 0 values 1 | s :='' 2 | _ = s.length | ^ @@ -17,7 +17,7 @@ vlib/v/checker/tests/invalid_property.vv:3:11: error: `[]int` has no property `f | ~~~ 4 | 5 | mut fa := [3,4]! -vlib/v/checker/tests/invalid_property.vv:3:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/invalid_property.vv:3:3: error: assignment mismatch: 1 variable 0 values 1 | s :='' 2 | _ = s.length 3 | _ = [1,2].foo @@ -29,7 +29,7 @@ vlib/v/checker/tests/invalid_property.vv:6:8: error: `[2]int` has no property `b 5 | mut fa := [3,4]! 6 | _ = fa.bar | ~~~ -vlib/v/checker/tests/invalid_property.vv:6:3: error: assignment mismatch: 1 variable(s) 0 value(s) +vlib/v/checker/tests/invalid_property.vv:6:3: error: assignment mismatch: 1 variable 0 values 4 | 5 | mut fa := [3,4]! 6 | _ = fa.bar diff --git a/vlib/v/checker/tests/invalid_variable_err.out b/vlib/v/checker/tests/invalid_variable_err.out index 20bdfd2e9..83c98b698 100644 --- a/vlib/v/checker/tests/invalid_variable_err.out +++ b/vlib/v/checker/tests/invalid_variable_err.out @@ -4,7 +4,7 @@ vlib/v/checker/tests/invalid_variable_err.vv:2:5: warning: unused variable: `b` | ^ 3 | if a { 4 | } -vlib/v/checker/tests/invalid_variable_err.vv:2:7: error: assignment mismatch: 2 variable(s) 1 value(s) +vlib/v/checker/tests/invalid_variable_err.vv:2:7: error: assignment mismatch: 2 variables 1 value 1 | fn main() { 2 | a, b := c | ~~ diff --git a/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out b/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out index 32a15977a..e597eb825 100644 --- a/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out +++ b/vlib/v/checker/tests/modules/enum_from_string_in_different_mods.out @@ -1,26 +1,26 @@ vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:3:8: warning: module 'mod' is imported but never used 1 | module main - 2 | + 2 | 3 | import mod { MyEnum, MyStruct } | ~~~ - 4 | + 4 | 5 | fn main() { vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:3:14: error: module `mod` type `MyEnum` is private 1 | module main - 2 | + 2 | 3 | import mod { MyEnum, MyStruct } | ~~~~~~ - 4 | + 4 | 5 | fn main() { vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:6:7: error: module `mod` type `mod.MyEnum` is private - 4 | + 4 | 5 | fn main() { 6 | _ := MyEnum.from_string('item1') | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 | _ := MyStruct.from_string('item1') 8 | } -vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:6:4: error: assignment mismatch: 1 variable(s) but `MyEnum.from_string()` returns 0 value(s) - 4 | +vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:6:4: error: assignment mismatch: 1 variable but `MyEnum.from_string()` returns 0 values + 4 | 5 | fn main() { 6 | _ := MyEnum.from_string('item1') | ~~ @@ -32,7 +32,7 @@ vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:7:7: 7 | _ := MyStruct.from_string('item1') | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | } -vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:7:4: error: assignment mismatch: 1 variable(s) but `MyStruct.from_string()` returns 0 value(s) +vlib/v/checker/tests/modules/enum_from_string_in_different_mods/src/main.v:7:4: error: assignment mismatch: 1 variable but `MyStruct.from_string()` returns 0 values 5 | fn main() { 6 | _ := MyEnum.from_string('item1') 7 | _ := MyStruct.from_string('item1') diff --git a/vlib/v/checker/tests/os_prefix.out b/vlib/v/checker/tests/os_prefix.out index ac35b74c8..b7bc06972 100644 --- a/vlib/v/checker/tests/os_prefix.out +++ b/vlib/v/checker/tests/os_prefix.out @@ -10,7 +10,7 @@ vlib/v/checker/tests/os_prefix.vv:5:12: error: unknown function: execute | ~~~~~~~~~~~~ 6 | println(result) 7 | } -vlib/v/checker/tests/os_prefix.vv:5:9: error: assignment mismatch: 1 variable(s) but `execute()` returns 0 value(s) +vlib/v/checker/tests/os_prefix.vv:5:9: error: assignment mismatch: 1 variable but `execute()` returns 0 values 3 | fn main() { 4 | cmd := "ls" 5 | result := execute(cmd) diff --git a/vlib/v/checker/tests/static_method_multi_return_err.out b/vlib/v/checker/tests/static_method_multi_return_err.out index 64f8c9ac2..422a6e8bf 100644 --- a/vlib/v/checker/tests/static_method_multi_return_err.out +++ b/vlib/v/checker/tests/static_method_multi_return_err.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/static_method_multi_return_err.vv:10:6: error: assignment mismatch: 1 variable(s) but `SomeStruct.static_method()` returns 2 value(s) +vlib/v/checker/tests/static_method_multi_return_err.vv:10:6: error: assignment mismatch: 1 variable but `SomeStruct.static_method()` returns 2 values 8 | 9 | fn main() { 10 | val := SomeStruct.static_method() diff --git a/vlib/v/checker/tests/static_method_not_found_err.out b/vlib/v/checker/tests/static_method_not_found_err.out index 2c74bf69c..d96f07412 100644 --- a/vlib/v/checker/tests/static_method_not_found_err.out +++ b/vlib/v/checker/tests/static_method_not_found_err.out @@ -5,7 +5,7 @@ vlib/v/checker/tests/static_method_not_found_err.vv:10:9: error: unknown functio | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 | println(val) 12 | } -vlib/v/checker/tests/static_method_not_found_err.vv:10:6: error: assignment mismatch: 1 variable(s) but `TestStruct.static_method()` returns 0 value(s) +vlib/v/checker/tests/static_method_not_found_err.vv:10:6: error: assignment mismatch: 1 variable but `TestStruct.static_method()` returns 0 values 8 | 9 | fn main() { 10 | val := TestStruct.static_method() diff --git a/vlib/v/checker/tests/top_level_fn_builtin_decl_err.out b/vlib/v/checker/tests/top_level_fn_builtin_decl_err.out index 564fcbd4d..373a5a0da 100644 --- a/vlib/v/checker/tests/top_level_fn_builtin_decl_err.out +++ b/vlib/v/checker/tests/top_level_fn_builtin_decl_err.out @@ -26,7 +26,7 @@ vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:19:31: error: unexpected ` | ^ 20 | 21 | assert got == 'a'[0] -vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:19:15: error: assignment mismatch: 2 variable(s) but `a_char()` returns 0 value(s) +vlib/v/checker/tests/top_level_fn_builtin_decl_err.vv:19:15: error: assignment mismatch: 2 variables but `a_char()` returns 0 values 17 | 18 | for i, input in inputs { 19 | got, remain := a_char(input)! diff --git a/vlib/v/checker/tests/unknown_method_suggest_name.out b/vlib/v/checker/tests/unknown_method_suggest_name.out index e1160739c..7db2bbf2b 100644 --- a/vlib/v/checker/tests/unknown_method_suggest_name.out +++ b/vlib/v/checker/tests/unknown_method_suggest_name.out @@ -14,7 +14,7 @@ Did you mean `translate`? | ~~~~~~~~~~~~ 28 | println('p: $p') 29 | println('v: $v') -vlib/v/checker/tests/unknown_method_suggest_name.vv:27:4: error: assignment mismatch: 1 variable(s) but `tranzlate()` returns 0 value(s) +vlib/v/checker/tests/unknown_method_suggest_name.vv:27:4: error: assignment mismatch: 1 variable but `tranzlate()` returns 0 values 25 | p := Point{1, 2, 3} 26 | v := Vector{x: 5, y: 5, z: 10} 27 | z := p.tranzlate(v) diff --git a/vlib/v/checker/tests/void_fn_as_value.out b/vlib/v/checker/tests/void_fn_as_value.out index f44853ec7..dd621a1e7 100644 --- a/vlib/v/checker/tests/void_fn_as_value.out +++ b/vlib/v/checker/tests/void_fn_as_value.out @@ -5,7 +5,7 @@ vlib/v/checker/tests/void_fn_as_value.vv:5:7: error: unknown function: x | ~~~~~~~~~~ 6 | mut b := 'abcdef' 7 | _ = b -vlib/v/checker/tests/void_fn_as_value.vv:5:4: error: assignment mismatch: 1 variable(s) but `x()` returns 0 value(s) +vlib/v/checker/tests/void_fn_as_value.vv:5:4: error: assignment mismatch: 1 variable but `x()` returns 0 values 3 | fn main() { 4 | mut a := 'aa' 5 | a += x('a','b') diff --git a/vlib/v/checker/tests/void_function_assign_to_string.out b/vlib/v/checker/tests/void_function_assign_to_string.out index b04d39c8b..edbb9b5e5 100644 --- a/vlib/v/checker/tests/void_function_assign_to_string.out +++ b/vlib/v/checker/tests/void_function_assign_to_string.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/void_function_assign_to_string.vv:6:4: error: assignment mismatch: 1 variable(s) but `x()` returns 0 value(s) +vlib/v/checker/tests/void_function_assign_to_string.vv:6:4: error: assignment mismatch: 1 variable but `x()` returns 0 values 4 | fn main(){ 5 | mut a := '' 6 | a = x(1,2) // hello -- 2.39.5