1
0
forked from aniani/vim

patch 8.2.1024: Vim9: no error for using "let g:var = val"

Problem:    Vim9: no error for using "let g:var = val".
Solution:   Add an error.
This commit is contained in:
Bram Moolenaar
2020-06-20 22:50:47 +02:00
parent 0cb5bcf583
commit 6797966dfc
10 changed files with 33 additions and 13 deletions

View File

@@ -2864,6 +2864,14 @@ set_var_const(
semsg(_(e_illvar), name);
return;
}
if (current_sctx.sc_version == SCRIPT_VERSION_VIM9
&& ht == &globvarht
&& (flags & LET_NO_COMMAND) == 0)
{
semsg(_(e_declare_global), name);
return;
}
is_script_local = ht == get_script_local_ht();
di = find_var_in_ht(ht, 0, varname, TRUE);