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.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index bdb0f06..5c4547d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1361,6 +1361,9 @@
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];