comparison 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
comparison
equal deleted inserted replaced
25283:dbf77501fe00 25284:29191571eceb
1356 { 1356 {
1357 if ((di == NULL 1357 if ((di == NULL
1358 || (!var_check_ro(di->di_flags, lp->ll_name, FALSE) 1358 || (!var_check_ro(di->di_flags, lp->ll_name, FALSE)
1359 && !tv_check_lock(&di->di_tv, lp->ll_name, FALSE))) 1359 && !tv_check_lock(&di->di_tv, lp->ll_name, FALSE)))
1360 && tv_op(&tv, rettv, op) == OK) 1360 && tv_op(&tv, rettv, op) == OK)
1361 set_var(lp->ll_name, &tv, FALSE); 1361 set_var_const(lp->ll_name, NULL, &tv, FALSE,
1362 ASSIGN_NO_DECL, 0);
1362 clear_tv(&tv); 1363 clear_tv(&tv);
1363 } 1364 }
1364 } 1365 }
1365 else 1366 else
1366 { 1367 {