Patch 8.2.4167

8 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 21, 2022, 5:36:00 AM1/21/22
to vim...@googlegroups.com

Patch 8.2.4167
Problem: Vim9: error message for old style import.
Solution: Use another error message. Add a test.
Files: src/evalvars.c, src/errors.h, src/testdir/test_vim9_import.vim


*** ../vim-8.2.4167/src/userfunc.c 2022-01-20 19:56:45.551663706 +0000
--- src/userfunc.c 2022-01-21 10:23:47.162218934 +0000
***************
*** 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));
--- 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 || (in_vim9script() && end != NULL
! && end[-1] == AUTOLOAD_CHAR && *end == '('))
{
if (!skip)
emsg(_(e_function_name_required));
*** ../vim-8.2.4167/src/testdir/test_autoload.vim 2020-08-12 17:50:31.871655841 +0100
--- src/testdir/test_autoload.vim 2022-01-21 10:30:10.854377174 +0000
***************
*** 10,15 ****
--- 10,18 ----
call assert_equal(1, g:called_foo_bar_echo)

eval 'bar'->g:foo#addFoo()->assert_equal('barfoo')
+
+ " empty name works in legacy script
+ call assert_equal('empty', foo#())
endfunc

func Test_source_autoload()
***************
*** 23,26 ****
--- 26,30 ----
call assert_equal(49, auto9#add42(7))
endfunc

+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4167/src/testdir/sautest/autoload/foo.vim 2019-08-04 21:44:34.000000000 +0100
--- src/testdir/sautest/autoload/foo.vim 2022-01-21 10:25:56.847483083 +0000
***************
*** 9,11 ****
--- 9,15 ----
func foo#addFoo(head)
return a:head .. 'foo'
endfunc
+
+ func foo#()
+ return 'empty'
+ endfunc
*** ../vim-8.2.4167/src/version.c 2022-01-20 21:32:50.331303977 +0000
--- src/version.c 2022-01-21 10:24:39.973105038 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4168,
/**/

--
Save the plankton - eat a whale.

/// 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 ///
Reply all
Reply to author
Forward
0 new messages