# HG changeset patch # User Bram Moolenaar # Date 1615398304 -3600 # Node ID 23c692a4bc369668a93f366960dc5b9bed729d51 # Parent 3865ddb3834ac0e53d8287ecd9bef0ea3990d47a patch 8.2.2584: Vim9: type error for assigning "any" to a list Commit: https://github.com/vim/vim/commit/d345fb921678613ffc66a8afc82bc0e815c72312 Author: Bram Moolenaar Date: Wed Mar 10 18:43:09 2021 +0100 patch 8.2.2584: Vim9: type error for assigning "any" to a list 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) diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1370,6 +1370,9 @@ def Test_expr5_list_add() 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2584, +/**/ 2583, /**/ 2582, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -4450,7 +4450,7 @@ compile_expr6(char_u **arg, cctx_T *cctx } /* - * + number addition + * + number addition or list/blobl concatenation * - number subtraction * .. string concatenation */ @@ -4532,6 +4532,7 @@ compile_expr5(char_u **arg, cctx_T *cctx else { generate_ppconst(cctx, ppconst); + ppconst->pp_is_const = FALSE; if (*op == '.') { if (may_generate_2STRING(-2, cctx) == FAIL