To: vim_dev@googlegroups.com Subject: Patch 8.2.4295 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4295 Problem: Vim9: concatenating two lists may result in wrong type. Solution: Remove the type instead of using list. (closes #9692) Files: src/list.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.4294/src/list.c 2022-02-03 21:47:30.562148940 +0000 --- src/list.c 2022-02-04 11:11:27.223938693 +0000 *************** *** 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 --- 1216,1225 ---- copy = list_alloc(); if (copy != NULL) { ! if (orig->lv_type == NULL || top || deep) copy->lv_type = NULL; else ! copy->lv_type = alloc_type(orig->lv_type); if (copyID != 0) { // Do this before adding the items, because one of the items may *** ../vim-8.2.4294/src/testdir/test_vim9_expr.vim 2022-02-03 21:47:30.562148940 +0000 --- src/testdir/test_vim9_expr.vim 2022-02-04 11:11:56.967856046 +0000 *************** *** 1500,1505 **** --- 1500,1511 ---- assert_equal([[1, 2]], lln) END v9.CheckDefAndScriptSuccess(lines) + + lines =<< trim END + var ln: list = [0] + var lln: list> = [ln + []] + END + v9.CheckDefAndScriptSuccess(lines) enddef " test multiply, divide, modulo *** ../vim-8.2.4294/src/version.c 2022-02-04 10:45:34.944240854 +0000 --- src/version.c 2022-02-04 11:36:10.866753534 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4295, /**/ -- The average life of an organization chart is six months. You can safely ignore any order from your boss that would take six months to complete. (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 ///