mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:8.2.2918: builtin function can be shadowed by global variable
Problem: Builtin function can be shadowed by global variable.
Solution: Check for builtin function before variable. (Yasuhiro Matsumoto,
closes vim/vim#8302)
3d9c4eefe6
Cherry-pick Test_gettext() from patch 8.2.2886.
This commit is contained in:
@@ -1760,6 +1760,13 @@ void set_var_lval(lval_T *lp, char *endp, typval_T *rettv, int copy, const bool
|
||||
semsg(_(e_dictkey), lp->ll_newkey);
|
||||
return;
|
||||
}
|
||||
if ((lp->ll_tv->vval.v_dict == &globvardict
|
||||
// || lp->ll_tv->vval.v_dict == &SCRIPT_ITEM(current_sctx.sc_sid)->sn_vars->sv_dict
|
||||
)
|
||||
&& (rettv->v_type == VAR_FUNC || rettv->v_type == VAR_PARTIAL)
|
||||
&& var_wrong_func_name(lp->ll_newkey, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Need to add an item to the Dictionary.
|
||||
di = tv_dict_item_alloc((const char *)lp->ll_newkey);
|
||||
|
Reference in New Issue
Block a user