diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-28 16:55:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-28 16:55:11 +0100 |
commit | 057e84afe5bd37fe272bf7cfafca629ef9da1bd3 (patch) | |
tree | c32b619151d50bf4df8061001e1515a9f267a085 /src/vim9script.c | |
parent | 087b5ff35d219f4f48a3d4854783799d0f6a1732 (diff) | |
download | vim-git-057e84afe5bd37fe272bf7cfafca629ef9da1bd3.tar.gz |
patch 8.2.2558: no error if a lambda argument shadows a variablev8.2.2558
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)
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 39d2eeb11..68d7f5e19 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -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 ..." |