forked from aniani/vim
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:
@@ -1024,9 +1024,11 @@ generate_UCALL(cctx_T *cctx, char_u *name, int argcount)
|
||||
isn->isn_arg.ufunc.cuf_argcount = argcount;
|
||||
|
||||
stack->ga_len -= argcount; // drop the arguments
|
||||
|
||||
// drop the funcref/partial, get back the return value
|
||||
((type_T **)stack->ga_data)[stack->ga_len - 1] = &t_any;
|
||||
if (ga_grow(stack, 1) == FAIL)
|
||||
return FAIL;
|
||||
// add return value
|
||||
((type_T **)stack->ga_data)[stack->ga_len] = &t_any;
|
||||
++stack->ga_len;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user