Patch 8.2.2681
Problem: Vim9: test fails for redeclaring script variable.
Solution: It's OK to assign to an existing script variable in legacy.
Files: src/evalvars.c
*** ../vim-8.2.2680/src/evalvars.c 2021-03-31 21:07:21.312591129 +0200
--- src/evalvars.c 2021-03-31 21:45:43.403242582 +0200
***************
*** 3219,3234 ****
goto failed;
}
if (var_in_vim9script)
{
where_T where;
- if ((flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
- {
- semsg(_(e_redefining_script_item_str), name);
- goto failed;
- }
-
// check the type and adjust to bool if needed
where.wt_index = var_idx;
where.wt_variable = TRUE;
--- 3219,3235 ----
goto failed;
}
+ if (is_script_local && vim9script
+ && (flags & (ASSIGN_NO_DECL | ASSIGN_DECL)) == 0)
+ {
+ semsg(_(e_redefining_script_item_str), name);
+ goto failed;
+ }
+
if (var_in_vim9script)
{
where_T where;
// check the type and adjust to bool if needed
where.wt_index = var_idx;
where.wt_variable = TRUE;
*** ../vim-8.2.2680/src/version.c 2021-03-31 21:07:21.312591129 +0200
--- src/version.c 2021-03-31 21:47:21.215034698 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2681,
/**/
--
Seen it all, done it all, can't remember most of it.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202103311947.12VJlwoU1767774%40masaka.moolenaar.net.