Mercurial > vim
diff src/eval.c @ 25284:29191571eceb v8.2.3179
patch 8.2.3179: Vim9: cannot assign to an imported variable at script level
Commit: https://github.com/vim/vim/commit/24e9316560bd5c9ea2e5a963335aedff025e7f66
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 18 20:40:33 2021 +0200
patch 8.2.3179: Vim9: cannot assign to an imported variable at script level
Problem: Vim9: cannot assign to an imported variable at script level.
Solution: Lookup imported items when assigning.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Jul 2021 20:45:04 +0200 |
parents | ca7a8ea2eb5f |
children | 4d3c68196d05 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -1358,7 +1358,8 @@ set_var_lval( || (!var_check_ro(di->di_flags, lp->ll_name, FALSE) && !tv_check_lock(&di->di_tv, lp->ll_name, FALSE))) && tv_op(&tv, rettv, op) == OK) - set_var(lp->ll_name, &tv, FALSE); + set_var_const(lp->ll_name, NULL, &tv, FALSE, + ASSIGN_NO_DECL, 0); clear_tv(&tv); } }