From d62d87d8f3f337a25b7da72abf55fc8a4bb6100c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Jan 2021 17:40:12 +0100 Subject: [PATCH] patch 8.2.2300: Vim9: wrong order on type stack when using dict Problem: Vim9: wrong order on type stack when using dict. Solution: Generate constants before a dict. (closes #7619) --- src/testdir/test_vim9_expr.vim | 2 ++ src/version.c | 2 ++ src/vim9compile.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index e613f106bb..4941650650 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 07113c4b3c..d106f3bab3 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2300, /**/ 2299, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 4007641bb0..0d19b7df52 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;