Patch 8.2.2481
Problem:    Vim9: confusing error when variable arguments have a default
            value.
Solution:   Give a specific error message. (closes #7793)
Files:      src/userfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.2480/src/userfunc.c      2021-02-07 15:28:05.792508596 +0100
--- src/userfunc.c      2021-02-07 15:52:48.255900979 +0100
***************
*** 241,246 ****
--- 241,251 ----
                                                                         skip);
                if (p == arg)
                    break;
+               if (*skipwhite(p) == '=')
+               {
+                   emsg(_(e_cannot_use_default_for_variable_arguments));
+                   break;
+               }
            }
        }
        else
*** ../vim-8.2.2480/src/testdir/test_vim9_func.vim      2021-01-31 
22:18:21.977811108 +0100
--- src/testdir/test_vim9_func.vim      2021-02-07 15:56:58.151121020 +0100
***************
*** 781,786 ****
--- 781,796 ----
        Func(1, 'a')
    END
    CheckScriptFailure(lines, 'E1013: Argument 1: type mismatch')
+ 
+   lines =<< trim END
+       vim9script
+       def Func(  # some comment
+                 ...l = []
+                 )
+         echo l
+       enddef
+   END
+   CheckScriptFailure(lines, 'E1160:')
  enddef
  
  let s:value = ''
*** ../vim-8.2.2480/src/version.c       2021-02-07 15:28:05.792508596 +0100
--- src/version.c       2021-02-07 15:57:35.447004907 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2481,
  /**/

-- 
Futility Factor: No experiment is ever a complete failure - it can always
serve as a negative example.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202102071500.117F0eJx2862435%40masaka.moolenaar.net.

Raspunde prin e-mail lui