# HG changeset patch # User Bram Moolenaar # Date 1609778703 -3600 # Node ID 8cce160b9183ba05d7b3a79eb0e2207d9d3e93bc # Parent 4ef3685b280a023ef0fe2c6bc64c80c8fb622d18 patch 8.2.2300: Vim9: wrong order on type stack when using dict Commit: https://github.com/vim/vim/commit/d62d87d8f3f337a25b7da72abf55fc8a4bb6100c Author: Bram Moolenaar Date: Mon Jan 4 17:40:12 2021 +0100 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 https://github.com/vim/vim/issues/7619) 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 @@ -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 --- 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 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -3027,6 +3027,8 @@ compile_dict(char_u **arg, cctx_T *cctx, if (d == NULL) return FAIL; + if (generate_ppconst(cctx, ppconst) == FAIL) + return FAIL; for (;;) { char_u *key = NULL;