]> granicus.if.org Git - vim/commitdiff
patch 8.2.4308: Vim9: cannot list autoload function v8.2.4308
authorBram Moolenaar <Bram@vim.org>
Sun, 6 Feb 2022 13:08:41 +0000 (13:08 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 6 Feb 2022 13:08:41 +0000 (13:08 +0000)
Problem:    Vim9: cannot list autoload function.
Solution:   Don't give an error for using # when listing a function.
            (closes #9703)

src/testdir/test_vim9_import.vim
src/userfunc.c
src/version.c

index be453c654eeef30c99f1dd1c26eab98bb32f8518..1e8851e92df53640e60ba96b0ab7da59faa0e61b 100644 (file)
@@ -1886,6 +1886,10 @@ def Test_vim9script_autoload_call()
       assert_equal('other', g:result)
 
       assert_equal('arg', call('another.RetArg', ['arg']))
+
+      verbose function another.Getother
+      # should we disallow this?
+      verbose function another#Getother
   END
   v9.CheckScriptSuccess(lines)
 
index 371cfd328a5086627db517bad563c882d9a09678..23131b7515e26a3d7600d6e6fc1b94a7c1ac85a3 100644 (file)
@@ -4232,7 +4232,7 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
                name = prefixed;
            }
        }
-       else if (vim9script && name != NULL
+       else if (paren && vim9script && name != NULL
                                    && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
        {
            emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead));
index 85d016eec5b8eef50f26fc167d275f80f7474e34..4c48d5f60c2bf62bec251fdfe25a9e2020516d35 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4308,
 /**/
     4307,
 /**/