comparison src/eval.c @ 24760:ca0f983f08cf v8.2.2918

patch 8.2.2918: builtin function can be shadowed by global variable Commit: https://github.com/vim/vim/commit/3d9c4eefe656ee8bf58c0496a48bd56bac180056 Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 31 22:15:26 2021 +0200 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 #8302)
author Bram Moolenaar <Bram@vim.org>
date Mon, 31 May 2021 22:30:02 +0200
parents bf8feac8a89a
children 3907cf9be745
comparison
equal deleted inserted replaced
24759:7603f2a9f1aa 24760:ca0f983f08cf
1460 if (op != NULL && *op != '=') 1460 if (op != NULL && *op != '=')
1461 { 1461 {
1462 semsg(_(e_dictkey), lp->ll_newkey); 1462 semsg(_(e_dictkey), lp->ll_newkey);
1463 return; 1463 return;
1464 } 1464 }
1465 if ((lp->ll_tv->vval.v_dict == get_globvar_dict()
1466 || lp->ll_tv->vval.v_dict ==
1467 &SCRIPT_ITEM(current_sctx.sc_sid)->sn_vars->sv_dict)
1468 && (rettv->v_type == VAR_FUNC
1469 || rettv->v_type == VAR_PARTIAL)
1470 && var_wrong_func_name(lp->ll_newkey, TRUE))
1471 return;
1465 1472
1466 // Need to add an item to the Dictionary. 1473 // Need to add an item to the Dictionary.
1467 di = dictitem_alloc(lp->ll_newkey); 1474 di = dictitem_alloc(lp->ll_newkey);
1468 if (di == NULL) 1475 if (di == NULL)
1469 return; 1476 return;