To: vim_dev@googlegroups.com Subject: Patch 8.2.4293 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4293 Problem: Vim9: when copying a list it gets type list even when the original list did not have a type. Solution: Only set the type when the original list has a type. (closes #9692) Files: src/list.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.4292/src/list.c 2022-02-02 20:01:21.957210955 +0000 --- src/list.c 2022-02-03 21:39:44.415081372 +0000 *************** *** 1216,1222 **** copy = list_alloc(); if (copy != NULL) { ! copy->lv_type = alloc_type(top || deep ? &t_list_any: orig->lv_type); if (copyID != 0) { // Do this before adding the items, because one of the items may --- 1216,1226 ---- copy = list_alloc(); if (copy != NULL) { ! if (orig->lv_type == NULL) ! copy->lv_type = NULL; ! else ! copy->lv_type = alloc_type(top || deep ! ? &t_list_any: orig->lv_type); if (copyID != 0) { // Do this before adding the items, because one of the items may *** ../vim-8.2.4292/src/testdir/test_vim9_expr.vim 2022-01-31 13:36:32.076275510 +0000 --- src/testdir/test_vim9_expr.vim 2022-02-03 21:42:51.254780198 +0000 *************** *** 1495,1500 **** --- 1495,1503 ---- # result of glob() is "any", runtime type check var sl: list = glob('*.txt', false, true) + [''] + + var lln: list> = [[1] + [2]] + assert_equal([[1, 2]], lln) END v9.CheckDefAndScriptSuccess(lines) enddef *** ../vim-8.2.4292/src/version.c 2022-02-03 21:29:35.820072136 +0000 --- src/version.c 2022-02-03 21:41:10.802942014 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4293, /**/ -- A consultant is a person who takes your money and annoys your employees while tirelessly searching for the best way to extend the consulting contract. (Scott Adams - The Dilbert principle) /// 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 ///