Patch 8.2.3107
Problem: Vim9: error for arguments while type didn't specify arguments.
Solution: Do not update that type to check when no argument count is
specified. (closes #8492)
Files: src/userfunc.c, src/testdir/test_vim9_assign.vim
*** ../vim-8.2.3106/src/userfunc.c 2021-07-04 20:20:48.165400896 +0200
--- src/userfunc.c 2021-07-04 23:28:17.821694166 +0200
***************
*** 3148,3154 ****
argvars = argv;
argcount = partial->pt_argc + argcount_in;
! if (funcexe->check_type != NULL)
{
// Now funcexe->check_type is missing the added arguments, make
// a copy of the type with the correction.
--- 3148,3155 ----
argvars = argv;
argcount = partial->pt_argc + argcount_in;
! if (funcexe->check_type != NULL
! && funcexe->check_type->tt_argcount != -1)
{
// Now funcexe->check_type is missing the added arguments, make
// a copy of the type with the correction.
*** ../vim-8.2.3106/src/testdir/test_vim9_assign.vim 2021-07-04 22:48:08.261371720 +0200
--- src/testdir/test_vim9_assign.vim 2021-07-04 23:26:22.225848237 +0200
***************
*** 681,686 ****
--- 681,696 ----
assert_equal('done', Partial())
END
CheckDefAndScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ def Func(b: bool)
+ enddef
+ var Ref: func = function(Func, [true])
+ assert_equal('func()', typename(Ref))
+ Ref()
+ END
+ CheckScriptSuccess(lines)
enddef
def Test_assignment_list_any_index()
*** ../vim-8.2.3106/src/version.c 2021-07-04 22:48:08.261371720 +0200
--- src/version.c 2021-07-04 23:24:16.770067985 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3107,
/**/
--
The sooner you fall behind, the more time you'll have to catch up.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///