Patch 8.2.1915
Problem: Vim9: error for wrong number of arguments is not useful.
Solution: Mention whatever we have for the name. (closes #7208)
Files: src/vim9compile.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.1914/src/vim9compile.c 2020-10-24 23:08:34.711491620 +0200
--- src/vim9compile.c 2020-10-28 14:24:36.599861395 +0100
***************
*** 1687,1698 ****
if (argcount < type->tt_min_argcount - varargs)
{
! semsg(_(e_toofewarg), "[reference]");
return FAIL;
}
if (!varargs && argcount > type->tt_argcount)
{
! semsg(_(e_toomanyarg), "[reference]");
return FAIL;
}
}
--- 1687,1698 ----
if (argcount < type->tt_min_argcount - varargs)
{
! semsg(_(e_toofewarg), name);
return FAIL;
}
if (!varargs && argcount > type->tt_argcount)
{
! semsg(_(e_toomanyarg), name);
return FAIL;
}
}
*** ../vim-8.2.1914/src/testdir/test_vim9_func.vim 2020-10-21
14:24:51.178015688 +0200
--- src/testdir/test_vim9_func.vim 2020-10-28 14:28:04.939271668 +0100
***************
*** 322,327 ****
--- 322,329 ----
CheckDefFailure(['bufnr(xxx)'], 'E1001:')
CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:')
+ CheckDefFailure(['echo {i -> 0}()'], 'E119: Not enough arguments for
function: {i -> 0}()')
+
var lines =<< trim END
vim9script
def Func(s: string)
***************
*** 1551,1557 ****
set eventignore=
autocmd QuickFixCmdPost * copen
def AutocmdsDisabled()
! eval 0
enddef
func Func()
noautocmd call s:AutocmdsDisabled()
--- 1553,1559 ----
set eventignore=
autocmd QuickFixCmdPost * copen
def AutocmdsDisabled()
! eval 0
enddef
func Func()
noautocmd call s:AutocmdsDisabled()
*** ../vim-8.2.1914/src/version.c 2020-10-28 13:53:46.553128946 +0100
--- src/version.c 2020-10-28 14:26:44.375499694 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1915,
/**/
--
hundred-and-one symptoms of being an internet addict:
143. You dream in pallettes of 216 websafe colors.
/// 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/202010281333.09SDXD5e2153011%40masaka.moolenaar.net.