Skip to content

Commit d62d87d

Browse files
committed
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)
1 parent d1510ee commit d62d87d

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/testdir/test_vim9_expr.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,8 @@ def Test_expr5()
10941094

10951095
$ENVVAR = 'env'
10961096
assert_equal('aenv', 'a' .. $ENVVAR)
1097+
1098+
assert_equal('val', '' .. {key: 'val'}['key'])
10971099
END
10981100
CheckDefAndScriptSuccess(lines)
10991101
enddef

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2300,
753755
/**/
754756
2299,
755757
/**/

src/vim9compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,6 +3027,8 @@ compile_dict(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
30273027

30283028
if (d == NULL)
30293029
return FAIL;
3030+
if (generate_ppconst(cctx, ppconst) == FAIL)
3031+
return FAIL;
30303032
for (;;)
30313033
{
30323034
char_u *key = NULL;

0 commit comments

Comments
 (0)