0
0
mirror of https://github.com/vim/vim.git synced 2025-11-01 10:07:16 -04:00

patch 8.2.2942: Vim9: error when calling function with too few arguments

Problem:    Vim9: internal error when calling function with too few arguments
Solution:   Check for argument count to be too few. (closes #8325)
This commit is contained in:
Bram Moolenaar
2021-06-05 18:15:09 +02:00
parent b288ba9f1d
commit 8da6d6db34
4 changed files with 23 additions and 0 deletions

View File

@@ -810,6 +810,15 @@ def Test_map_function_arg()
assert_equal(['0:a', '1:b', '2:c'], l)
END
CheckDefAndScriptSuccess(lines)
lines =<< trim END
range(3)->map((a, b, c) => a + b + c)
END
CheckDefExecAndScriptFailure(lines, 'E1190: One argument too few')
lines =<< trim END
range(3)->map((a, b, c, d) => a + b + c + d)
END
CheckDefExecAndScriptFailure(lines, 'E1190: 2 arguments too few')
enddef
def Test_map_item_type()