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.
diff --git a/src/eval.c b/src/eval.c
index 058b2d3..77774b7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1358,7 +1358,8 @@
|| (!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);
}
}