Patch 8.2.4311
Problem: Vim9: changing script variable type not caught at compile time.
Solution: Set the declared type.
Files: src/vim9instr.c, src/testdir/test_vim9_assign.vim
*** ../vim-8.2.4310/src/vim9instr.c 2022-02-06 15:49:32.373256554 +0000
--- src/vim9instr.c 2022-02-06 17:13:12.890893334 +0000
***************
*** 1040,1046 ****
RETURN_OK_IF_SKIP(cctx);
if (isn_type == ISN_LOADSCRIPT)
! isn = generate_instr_type(cctx, isn_type, type);
else
isn = generate_instr_drop(cctx, isn_type, 1);
if (isn == NULL)
--- 1040,1046 ----
RETURN_OK_IF_SKIP(cctx);
if (isn_type == ISN_LOADSCRIPT)
! isn = generate_instr_type2(cctx, isn_type, type, type);
else
isn = generate_instr_drop(cctx, isn_type, 1);
if (isn == NULL)
*** ../vim-8.2.4310/src/testdir/test_vim9_assign.vim 2022-02-04 21:17:54.412950056 +0000
--- src/testdir/test_vim9_assign.vim 2022-02-06 17:12:59.418910896 +0000
***************
*** 692,697 ****
--- 692,707 ----
END
v9.CheckDefExecAndScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected list<number> but got list<string>', 4)
unlet g:myList
+
+ lines =<< trim END
+ vim9script
+ var lds = [1, 2, 3]
+ def Func()
+ echo lds->extend(['x'])
+ enddef
+ defcompile
+ END
+ v9.CheckScriptFailure(lines, 'E1013:')
enddef
def Test_extend_dict()
*** ../vim-8.2.4310/src/version.c 2022-02-06 15:49:32.377256545 +0000
--- src/version.c 2022-02-06 17:16:14.542655581 +0000
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4311,
/**/
--
hundred-and-one symptoms of being an internet addict:
13. You refer to going to the bathroom as downloading.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///