To: vim_dev@googlegroups.com Subject: Patch 8.2.4163 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///