diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-04 15:54:08 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-04 15:54:08 +0200 |
commit | 7a40ff00edd35cc4313d74a43e7a7b67cd24372d (patch) | |
tree | f635249daa4d7c43565d33eaf6015a2b624c24f6 /src/evalfunc.c | |
parent | 4197828dc666f2d258594f7f9461534d23cc50e4 (diff) |
patch 8.2.3100: Vim9: no error when using type with unknown number of argsv8.2.3100
Problem: Vim9: no error when using type with unknown number of arguments.
Solution: Do not ignore argument count of -1. (closes #8492)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index e635116786..ec74fdeeae 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2055,6 +2055,18 @@ internal_func_check_arg_types( } /* + * Get the argument count for function "idx". + * "argcount" is the total argument count, "min_argcount" the non-optional + * argument count. + */ + void +internal_func_get_argcount(int idx, int *argcount, int *min_argcount) +{ + *argcount = global_functions[idx].f_max_argc; + *min_argcount = global_functions[idx].f_min_argc; +} + +/* * Call the "f_retfunc" function to obtain the return type of function "idx". * "argtypes" is the list of argument types or NULL when there are no * arguments. |