forked from aniani/vim
patch 8.2.0973: Vim9: type is not checked when assigning to a script variable
Problem: Vim9: type is not checked when assigning to a script variable. Solution: Check the type.
This commit is contained in:
@@ -2883,12 +2883,17 @@ set_var_const(
|
||||
|| var_check_lock(di->di_tv.v_lock, name, FALSE))
|
||||
return;
|
||||
|
||||
if ((flags & LET_NO_COMMAND) == 0
|
||||
&& is_script_local
|
||||
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
if (is_script_local
|
||||
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9)
|
||||
{
|
||||
semsg(_("E1041: Redefining script item %s"), name);
|
||||
return;
|
||||
if ((flags & LET_NO_COMMAND) == 0)
|
||||
{
|
||||
semsg(_("E1041: Redefining script item %s"), name);
|
||||
return;
|
||||
}
|
||||
|
||||
// check the type
|
||||
check_script_var_type(&di->di_tv, tv, name);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user