1
0
forked from aniani/vim

patch 8.2.3186: Vim9: not all failures for import tested

Problem:    Vim9: not all failures for import tested
Solution:   Test more import failures
This commit is contained in:
Bram Moolenaar
2021-07-19 21:45:07 +02:00
parent ac2cd2b08f
commit 605793500b
4 changed files with 38 additions and 5 deletions

View File

@@ -3250,6 +3250,7 @@ set_var_const(
{
scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);
svar_T *sv;
where_T where;
// imported variable from another script
if ((flags & ASSIGN_NO_DECL) == 0)
@@ -3257,10 +3258,16 @@ set_var_const(
semsg(_(e_redefining_imported_item_str), name);
goto failed;
}
sv = ((svar_T *)si->sn_var_vals.ga_data)
+ import->imp_var_vals_idx;
// TODO: check the type
// TODO: check for const and locked
sv = ((svar_T *)si->sn_var_vals.ga_data) + import->imp_var_vals_idx;
where.wt_index = 0;
where.wt_variable = TRUE;
if (check_typval_type(sv->sv_type, tv, where) == FAIL
|| value_check_lock(sv->sv_tv->v_lock, name, FALSE))
{
goto failed;
}
dest_tv = sv->sv_tv;
clear_tv(dest_tv);
}