To: vim_dev@googlegroups.com Subject: Patch 8.2.2584 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2584 Problem: Vim9: type error for assigning the result of list concatenation to a list. Solution: Do not consider concatenation result in a constant. (closes #7942) Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.2583/src/vim9compile.c 2021-03-06 21:01:05.865089577 +0100 --- src/vim9compile.c 2021-03-10 18:42:25.677484820 +0100 *************** *** 4450,4456 **** } /* ! * + number addition * - number subtraction * .. string concatenation */ --- 4450,4456 ---- } /* ! * + number addition or list/blobl concatenation * - number subtraction * .. string concatenation */ *************** *** 4532,4537 **** --- 4532,4538 ---- else { generate_ppconst(cctx, ppconst); + ppconst->pp_is_const = FALSE; if (*op == '.') { if (may_generate_2STRING(-2, cctx) == FAIL *** ../vim-8.2.2583/src/testdir/test_vim9_expr.vim 2021-03-06 18:18:15.370336953 +0100 --- src/testdir/test_vim9_expr.vim 2021-03-10 18:41:57.213547971 +0100 *************** *** 1370,1375 **** --- 1370,1378 ---- dany[i] = i endfor assert_equal({a: 'a', 12: 12}, dany) + + # result of glob() is "any", runtime type check + var sl: list = glob('*.txt', false, true) + [''] enddef " test multiply, divide, modulo *** ../vim-8.2.2583/src/version.c 2021-03-10 16:08:22.737770798 +0100 --- src/version.c 2021-03-10 18:19:05.756509292 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2584, /**/ -- Bad programs can be written in any language. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///