0
0
mirror of https://github.com/vim/vim.git synced 2025-11-12 22:44:34 -05:00

patch 8.2.2747: Vim9: not always an error for too many function arguments

Problem:    Vim9: not always an error for too many function arguments.
Solution:   Check for getting too many arguments.
This commit is contained in:
Bram Moolenaar
2021-04-10 20:10:26 +02:00
parent 87795939d0
commit bb8a7ce0a1
4 changed files with 27 additions and 4 deletions

View File

@@ -506,7 +506,7 @@ def Test_filter_wrong_dict_key_type()
enddef
def Test_filter_return_type()
var l = filter([1, 2, 3], () => 1)
var l = filter([1, 2, 3], (_, _) => 1)
var res = 0
for n in l
res += n
@@ -516,7 +516,7 @@ enddef
def Test_filter_missing_argument()
var dict = {aa: [1], ab: [2], ac: [3], de: [4]}
var res = dict->filter((k) => k =~ 'a' && k !~ 'b')
var res = dict->filter((k, _) => k =~ 'a' && k !~ 'b')
res->assert_equal({aa: [1], ac: [3]})
enddef