mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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 #8096)
This commit is contained in:
@@ -2637,6 +2637,8 @@ def Test_ignored_argument()
|
|||||||
return _
|
return _
|
||||||
endfunc
|
endfunc
|
||||||
assert_equal('too', Oktoo())
|
assert_equal('too', Oktoo())
|
||||||
|
|
||||||
|
assert_equal([[1], [2], [3]], range(3)->mapnew((_, v) => [v]->map((_, w) => w + 1)))
|
||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
CheckScriptSuccess(lines)
|
||||||
|
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2750,
|
||||||
/**/
|
/**/
|
||||||
2749,
|
2749,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -422,6 +422,10 @@ check_defined(char_u *p, size_t len, cctx_T *cctx, int is_arg)
|
|||||||
int c = p[len];
|
int c = p[len];
|
||||||
ufunc_T *ufunc = NULL;
|
ufunc_T *ufunc = NULL;
|
||||||
|
|
||||||
|
// underscore argument is OK
|
||||||
|
if (len == 1 && *p == '_')
|
||||||
|
return OK;
|
||||||
|
|
||||||
if (script_var_exists(p, len, cctx) == OK)
|
if (script_var_exists(p, len, cctx) == OK)
|
||||||
{
|
{
|
||||||
if (is_arg)
|
if (is_arg)
|
||||||
|
Reference in New Issue
Block a user