Patch 8.2.4163
Problem:    No error for omitting function name after autoload prefix.
Solution:   Check for missing function name. (issue #9577)
Files:      src/userfunc.c, src/testdir/test_vim9_import.vim


*** ../vim-8.2.4162/src/userfunc.c      2022-01-20 19:10:20.498583720 +0000
--- src/userfunc.c      2022-01-20 19:36:38.222320264 +0000
***************
*** 3693,3699 ****
      // Note that TFN_ flags use the same values as GLV_ flags.
      end = get_lval(start, NULL, &lv, FALSE, skip, flags | GLV_READ_ONLY,
                                              lead > 2 ? 0 : FNE_CHECK_START);
!     if (end == start)
      {
        if (!skip)
            emsg(_(e_function_name_required));
--- 3693,3700 ----
      // Note that TFN_ flags use the same values as GLV_ flags.
      end = get_lval(start, NULL, &lv, FALSE, skip, flags | GLV_READ_ONLY,
                                              lead > 2 ? 0 : FNE_CHECK_START);
!     if (end == start
!                  || (end != NULL && end[-1] == AUTOLOAD_CHAR && *end == '('))
      {
        if (!skip)
            emsg(_(e_function_name_required));
*** ../vim-8.2.4162/src/testdir/test_vim9_import.vim    2022-01-20 
19:10:20.498583720 +0000
--- src/testdir/test_vim9_import.vim    2022-01-20 19:31:38.064299582 +0000
***************
*** 1514,1519 ****
--- 1514,1534 ----
    delete('Xdir', 'rf')
  enddef
  
+ def Test_autoload_missing_function_name()
+   mkdir('Xdir/autoload', 'p')
+ 
+   var lines =<< trim END
+      vim9script
+ 
+      def loadme#()
+      enddef
+   END
+   writefile(lines, 'Xdir/autoload/loadme.vim')
+   assert_fails('source Xdir/autoload/loadme.vim', 'E129:')
+ 
+   delete('Xdir', 'rf')
+ enddef
+ 
  def Test_import_autoload_postponed()
    mkdir('Xdir/autoload', 'p')
    var save_rtp = &rtp
*** ../vim-8.2.4162/src/version.c       2022-01-20 19:10:20.498583720 +0000
--- src/version.c       2022-01-20 19:37:30.921272589 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4163,
  /**/

-- 
TALL KNIGHT: When you have found the shrubbery, then you must cut down the
             mightiest tree in the forest ... with a herring.
                 "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/20220120193922.1EB3B1C188D%40moolenaar.net.

Raspunde prin e-mail lui