diff src/vim9compile.c @ 24420:e0fa539a9b34 v8.2.2750

patch 8.2.2750: Vim9: error for using underscore in nested function Commit: https://github.com/vim/vim/commit/da479c7597a61c4d50c842df21c9294bd9bf1037 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 10 21:01:38 2021 +0200 patch 8.2.2750: Vim9: error for using underscore in nested function Problem: Vim9: error for using underscore in nested function. Solution: Do not consider "_" already defined. (closes https://github.com/vim/vim/issues/8096)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Apr 2021 21:15:04 +0200
parents 96e0b898d5b4
children 78343859f42d
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -422,6 +422,10 @@ check_defined(char_u *p, size_t len, cct
     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)