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)
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim
index 3fa5eb3..9cae4a3 100644
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -810,6 +810,15 @@
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()