0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2558: no error if a lambda argument shadows a variable

Problem:    No error if a lambda argument shadows a variable.
Solution:   Check that the argument name shadows a local, argument or script
            variable. (closes #7898)
This commit is contained in:
Bram Moolenaar
2021-02-28 16:55:11 +01:00
parent 087b5ff35d
commit 057e84afe5
9 changed files with 80 additions and 33 deletions

View File

@@ -370,7 +370,7 @@ handle_import(
if (eval_isnamec1(*arg))
while (eval_isnamec(*arg))
++arg;
if (check_defined(p, arg - p, cctx) == FAIL)
if (check_defined(p, arg - p, cctx, FALSE) == FAIL)
goto erret;
as_name = vim_strnsave(p, arg - p);
arg = skipwhite_and_linebreak(arg, evalarg);
@@ -555,7 +555,7 @@ handle_import(
}
else
{
if (check_defined(name, len, cctx) == FAIL)
if (check_defined(name, len, cctx, FALSE) == FAIL)
goto erret;
imported = new_imported(gap != NULL ? gap
@@ -567,7 +567,7 @@ handle_import(
{
imported->imp_name = name;
((char_u **)names.ga_data)[i] = NULL;
}
}
else
{
// "import This as That ..."