1
0
forked from aniani/vim

patch 8.2.4460: Vim9: wrong error for defining dict function

Problem:    Vim9: wrong error for defining dict function.
Solution:   Explicitly check for trying to define a dict function.
            (closes 9827)
This commit is contained in:
Bram Moolenaar
2022-02-23 22:12:02 +00:00
parent fa02616718
commit dea5ab0fc5
5 changed files with 80 additions and 5 deletions

View File

@@ -831,7 +831,11 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free)
{
if (!ends_excmd2(name_start, name_end))
{
semsg(_(e_invalid_command_str), eap->cmd);
if (*skipwhite(name_end) == '.')
semsg(_(e_cannot_define_dict_func_in_vim9_script_str),
eap->cmd);
else
semsg(_(e_invalid_command_str), eap->cmd);
return NULL;
}