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 -- b...@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    ///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202107042130.164LU2RM2626704%40masaka.moolenaar.net.

Raspunde prin e-mail lui