forked from aniani/vim
patch 8.2.2681: Vim9: test fails for redeclaring script variable
Problem: Vim9: test fails for redeclaring script variable. Solution: It's OK to assign to an existing script variable in legacy.
This commit is contained in:
@@ -3219,16 +3219,17 @@ set_var_const(
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (is_script_local && vim9script
|
||||
&& (flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (var_in_vim9script)
|
||||
{
|
||||
where_T where;
|
||||
|
||||
if ((flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
|
||||
{
|
||||
semsg(_(e_redefining_script_item_str), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
// check the type and adjust to bool if needed
|
||||
where.wt_index = var_idx;
|
||||
where.wt_variable = TRUE;
|
||||
|
Reference in New Issue
Block a user