Patch 8.2.4533
Problem:    Vim9: no test that after assigning null the type is still checked.
Solution:   Add a test.
Files:      src/testdir/test_vim9_assign.vim


*** ../vim-8.2.4532/src/testdir/test_vim9_assign.vim    2022-03-08 
13:18:10.813020777 +0000
--- src/testdir/test_vim9_assign.vim    2022-03-09 19:45:33.085471163 +0000
***************
*** 340,349 ****
--- 340,374 ----
          var j: job = null_job
          var c: channel = null_channel
        endif
+ 
+       var d: dict<func> = {a: function('tr'), b: null_function}
    END
    v9.CheckDefAndScriptSuccess(lines)
  enddef
  
+ def Test_keep_type_after_assigning_null()
+   var lines =<< trim END
+       var b: blob
+       b = null_blob
+       b = 'text'
+   END
+   v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected blob 
but got string')
+ 
+   lines =<< trim END
+       var l: list<number>
+       l = null_list
+       l = ['text']
+   END
+   v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected 
list<number> but got list<string>')
+ 
+   lines =<< trim END
+       var d: dict<string>
+       d = null_dict
+       d = {a: 1, b: 2}
+   END
+   v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected 
dict<string> but got dict<number>')
+ enddef
+ 
  def Test_skipped_assignment()
    var lines =<< trim END
        for x in []
*** ../vim-8.2.4532/src/version.c       2022-03-09 14:32:59.617641710 +0000
--- src/version.c       2022-03-09 19:34:17.543475327 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4533,
  /**/

-- 
I noticed my daughter's Disney-net password on a sticky note:
"MickeyMinnieGoofyPluto".  I asked her why it was so long.
"Because they say it has to have at least four characters."

 /// 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/20220309194800.EE8C51C174C%40moolenaar.net.

Raspunde prin e-mail lui