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 -- [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/20220206171943.B29EB1C071D%40moolenaar.net.

Raspunde prin e-mail lui