patch 8.2.2739: Vim9: a lambda accepts too many arguments at the script level
Problem: Vim9: a lambda accepts too many arguments at the script level.
Solution: Do not set uf_varargs in Vim9 script.
diff --git a/src/userfunc.c b/src/userfunc.c
index af107b0..81a73e2 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1263,8 +1263,9 @@
#endif
if (sandbox)
flags |= FC_SANDBOX;
- // can be called with more args than uf_args.ga_len
- fp->uf_varargs = TRUE;
+ // In legacy script a lambda can be called with more args than
+ // uf_args.ga_len.
+ fp->uf_varargs = !in_vim9script();
fp->uf_flags = flags;
fp->uf_calls = 0;
fp->uf_script_ctx = current_sctx;