Mercurial > vim
diff src/vim9script.c @ 24033:308d29307910 v8.2.2558
patch 8.2.2558: no error if a lambda argument shadows a variable
Commit: https://github.com/vim/vim/commit/057e84afe5bd37fe272bf7cfafca629ef9da1bd3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 28 16:55:11 2021 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Feb 2021 17:00:04 +0100 |
parents | 2ff087b47127 |
children | fc4c2beea99a |
line wrap: on
line diff
--- 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 ..."