diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/evalfunc.c | 3 | ||||
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index e4fa35b4ef..9e0fd805d8 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -3998,7 +3998,8 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) int is_global = FALSE; if (in_vim9script() - && (check_for_opt_list_arg(argvars, 1) == FAIL + && (check_for_string_or_func_arg(argvars, 0) == FAIL + || check_for_opt_list_arg(argvars, 1) == FAIL || (argvars[1].v_type != VAR_UNKNOWN && check_for_opt_dict_arg(argvars, 2) == FAIL))) return; diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 1bdb12b039..547a2132a4 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -1352,6 +1352,8 @@ def Test_funcref() enddef def Test_function() + CheckDefExecAndScriptFailure(['function(123)'], 'E1256: String or function required for argument 1') + CheckDefAndScriptFailure(['function("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) CheckDefAndScriptFailure(['function("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) diff --git a/src/version.c b/src/version.c index c4e4ad0814..80d92fc66d 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3895, +/**/ 3894, /**/ 3893, |