]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2300: Vim9: wrong order on type stack when using dict v8.2.2300
authorBram Moolenaar <Bram@vim.org>
Mon, 4 Jan 2021 16:40:12 +0000 (17:40 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 4 Jan 2021 16:40:12 +0000 (17:40 +0100)
Problem:    Vim9: wrong order on type stack when using dict.
Solution:   Generate constants before a dict. (closes #7619)

src/testdir/test_vim9_expr.vim
src/version.c
src/vim9compile.c

index e613f106bbbc75ce62cb42524617c5547fe290f0..4941650650220e4f20ce48d880b8e3a5103c094d 100644 (file)
@@ -1094,6 +1094,8 @@ def Test_expr5()
 
       $ENVVAR = 'env'
       assert_equal('aenv', 'a' .. $ENVVAR)
+
+      assert_equal('val', '' .. {key: 'val'}['key'])
   END
   CheckDefAndScriptSuccess(lines)
 enddef
index 07113c4b3cf4bb63a975fe2f5b873f76967ff234..d106f3bab31ad393d759eaef6f00dbb411b5a508 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2300,
 /**/
     2299,
 /**/
index 4007641bb0e8084aa373e9655d24a8bef1083ce8..0d19b7df52742203695e9022dfb9a507e2357bb6 100644 (file)
@@ -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;