Patch 8.2.2943
Problem:    Vim9: check for argument count ignores default values.
Solution:   Take default argument values into account.
Files:      src/vim9execute.c


*** ../vim-8.2.2942/src/vim9execute.c   2021-06-05 18:15:06.614037266 +0200
--- src/vim9execute.c   2021-06-05 18:48:09.805886192 +0200
***************
*** 4234,4240 ****
            semsg(_(e_nr_arguments_too_many), idx);
        goto failed_early;
      }
!     else if (idx < 0)
      {
        if (idx == -1)
            emsg(_(e_one_argument_too_few));
--- 4234,4241 ----
            semsg(_(e_nr_arguments_too_many), idx);
        goto failed_early;
      }
!     idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
!     if (idx < 0)
      {
        if (idx == -1)
            emsg(_(e_one_argument_too_few));
*** ../vim-8.2.2942/src/version.c       2021-06-05 18:15:06.614037266 +0200
--- src/version.c       2021-06-05 18:47:37.281956040 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2943,
  /**/

-- 
INSPECTOR END OF FILM: Move along.  There's nothing to see!  Keep moving!
   [Suddenly he notices the cameras.]
INSPECTOR END OF FILM: (to Camera) All right, put that away sonny.
   [He walks over to it and puts his hand over the lens.]
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202106051650.155Go2O3088329%40masaka.moolenaar.net.

Raspunde prin e-mail lui