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

patch 8.2.1454: Vim9: failure invoking lambda with wrong arguments

Problem:    Vim9: failure invoking lambda with wrong arguments.
Solution:   Handle invalid arguments.  Add a test.
This commit is contained in:
Bram Moolenaar
2020-08-14 22:16:33 +02:00
parent 8de2f44ac6
commit 79e8db9a21
4 changed files with 17 additions and 1 deletions

View File

@@ -1361,6 +1361,9 @@ generate_CALL(cctx_T *cctx, ufunc_T *ufunc, int pushed_argcount)
continue;
expected = ufunc->uf_arg_types[i];
}
else if (ufunc->uf_va_type == NULL)
// possibly a lambda
expected = &t_any;
else
expected = ufunc->uf_va_type->tt_member;
actual = ((type_T **)stack->ga_data)[stack->ga_len - argcount + i];