mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1391: Vim9: no error for shadowing a script function
Problem: Vim9: no error for shadowing a script function. Solution: Check for already defined items. (closes #6652)
This commit is contained in:
@@ -1780,6 +1780,18 @@ def Test_func_redefine_fails()
|
|||||||
enddef
|
enddef
|
||||||
END
|
END
|
||||||
CheckScriptFailure(lines, 'E1073:')
|
CheckScriptFailure(lines, 'E1073:')
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
def Foo(): string
|
||||||
|
return 'foo'
|
||||||
|
enddef
|
||||||
|
def Func()
|
||||||
|
let Foo = {-> 'lambda'}
|
||||||
|
enddef
|
||||||
|
defcompile
|
||||||
|
END
|
||||||
|
CheckScriptFailure(lines, 'E1073:')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_fixed_size_list()
|
def Test_fixed_size_list()
|
||||||
|
@@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
1391,
|
||||||
/**/
|
/**/
|
||||||
1390,
|
1390,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -5462,6 +5462,8 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
semsg(_(e_unknown_var), name);
|
semsg(_(e_unknown_var), name);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
|
else if (check_defined(var_start, varlen, cctx) == FAIL)
|
||||||
|
goto theend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user