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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user