To: vim_dev@googlegroups.com Subject: Patch 8.2.4533 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 = {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 + l = null_list + l = ['text'] + END + v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected list but got list') + + lines =<< trim END + var d: dict + d = null_dict + d = {a: 1, b: 2} + END + v9.CheckDefExecAndScriptFailure(lines, 'E1012: Type mismatch; expected dict but got dict') + 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 -- Bram@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 ///