summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-04-10 21:01:38 +0200
committerBram Moolenaar <Bram@vim.org>2021-04-10 21:01:38 +0200
commitda479c7597a61c4d50c842df21c9294bd9bf1037 (patch)
tree44a5cbf9c031551b9fcd79f69c727d2d7566f912 /src/vim9compile.c
parentfe95b94ffa75c4925ad16c43f94092f2b1d35fc6 (diff)
downloadvim-git-da479c7597a61c4d50c842df21c9294bd9bf1037.tar.gz
patch 8.2.2750: Vim9: error for using underscore in nested functionv8.2.2750
Problem: Vim9: error for using underscore in nested function. Solution: Do not consider "_" already defined. (closes #8096)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index b005ff236..02c75c4d6 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -422,6 +422,10 @@ check_defined(char_u *p, size_t len, cctx_T *cctx, int is_arg)
int c = p[len];
ufunc_T *ufunc = NULL;
+ // underscore argument is OK
+ if (len == 1 && *p == '_')
+ return OK;
+
if (script_var_exists(p, len, cctx) == OK)
{
if (is_arg)