mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2540: Vim9: no error for using script var name for argument
Problem: Vim9: no error for using script var name for argument. Solution: Check for this error. (closes #7868)
This commit is contained in:
@@ -80,6 +80,14 @@ one_function_arg(
|
||||
semsg(_("E125: Illegal argument: %s"), arg);
|
||||
return arg;
|
||||
}
|
||||
|
||||
// Vim9 script: cannot use script var name for argument.
|
||||
if (argtypes != NULL && script_var_exists(arg, p - arg, FALSE, NULL) == OK)
|
||||
{
|
||||
semsg(_(e_variable_already_declared_in_script), arg);
|
||||
return arg;
|
||||
}
|
||||
|
||||
if (newargs != NULL && ga_grow(newargs, 1) == FAIL)
|
||||
return arg;
|
||||
if (newargs != NULL)
|
||||
|
Reference in New Issue
Block a user