summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-04 17:40:12 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-04 17:40:12 +0100
commitd62d87d8f3f337a25b7da72abf55fc8a4bb6100c (patch)
tree2f3fd08cc915f6828cd3eb58a6c333ed8b956acc
parentd1510ee9469f623c872a18b6e3c3666c0fb23c58 (diff)
downloadvim-git-d62d87d8f3f337a25b7da72abf55fc8a4bb6100c.tar.gz
patch 8.2.2300: Vim9: wrong order on type stack when using dictv8.2.2300
Problem: Vim9: wrong order on type stack when using dict. Solution: Generate constants before a dict. (closes #7619)
-rw-r--r--src/testdir/test_vim9_expr.vim2
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index e613f106b..494165065 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1094,6 +1094,8 @@ def Test_expr5()
$ENVVAR = 'env'
assert_equal('aenv', 'a' .. $ENVVAR)
+
+ assert_equal('val', '' .. {key: 'val'}['key'])
END
CheckDefAndScriptSuccess(lines)
enddef
diff --git a/src/version.c b/src/version.c
index 07113c4b3..d106f3bab 100644
--- 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 */
/**/
+ 2300,
+/**/
2299,
/**/
2298,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 4007641bb..0d19b7df5 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3027,6 +3027,8 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
if (d == NULL)
return FAIL;
+ if (generate_ppconst(cctx, ppconst) == FAIL)
+ return FAIL;
for (;;)
{
char_u *key = NULL;