0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0206: calling Vim9 function using default argument fails

Problem:    Calling Vim9 function using default argument fails.
Solution:   Give an appropriate error. (closes #5572)
This commit is contained in:
Bram Moolenaar
2020-02-04 21:24:15 +01:00
parent a5edb670dc
commit 26e117e9bc
4 changed files with 42 additions and 3 deletions

View File

@@ -362,6 +362,7 @@ call_def_function(
int idx;
int ret = FAIL;
dfunc_T *dfunc;
int optcount = ufunc_argcount(ufunc) - argc;
// Get pointer to item in the stack.
#define STACK_TV(idx) (((typval_T *)ectx.ec_stack.ga_data) + idx)
@@ -392,6 +393,12 @@ call_def_function(
ectx.ec_frame = ectx.ec_stack.ga_len;
initial_frame_ptr = ectx.ec_frame;
// TODO: Put omitted argument default values on the stack.
if (optcount > 0)
{
emsg("optional arguments not implemented yet");
return FAIL;
}
// dummy frame entries
for (idx = 0; idx < STACK_FRAME_SIZE; ++idx)
{