summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/testdir/test_vim9_expr.vim3
-rw-r--r--src/version.c2
-rw-r--r--src/vim9execute.c6
3 files changed, 9 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 38b2afecd..cd5f15207 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -2774,6 +2774,9 @@ def Test_expr8_dict()
v9.CheckScriptFailure(['vim9script', "var x = {xxx: 1,"], 'E723:', 2)
v9.CheckDefAndScriptFailure(["var x = {['a']: xxx}"], ['E1001:', 'E121:'], 1)
v9.CheckDefAndScriptFailure(["var x = {a: 1, a: 2}"], 'E721:', 1)
+ g:key = 'x'
+ v9.CheckDefExecAndScriptFailure(["var x = {[g:key]: 'text', [g:key]: 'text'}"], 'E721:', 1)
+ unlet g:key
v9.CheckDefExecAndScriptFailure(["var x = g:anint.member"], ['E715:', 'E488:'], 1)
v9.CheckDefExecAndScriptFailure(["var x = g:dict_empty.member"], 'E716:', 1)
diff --git a/src/version.c b/src/version.c
index 0e42966d9..9e1b5c7ef 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4697,
+/**/
4696,
/**/
4695,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 6303cc117..99135eadd 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -196,8 +196,10 @@ exe_newdict(int count, ectx_T *ectx)
dict_unref(dict);
return FAIL;
}
- item->di_tv = *STACK_TV_BOT(2 * (idx - count) + 1);
+ tv = STACK_TV_BOT(2 * (idx - count) + 1);
+ item->di_tv = *tv;
item->di_tv.v_lock = 0;
+ tv->v_type = VAR_UNKNOWN;
if (dict_add(dict, item) == FAIL)
{
// can this ever happen?
@@ -5363,7 +5365,7 @@ call_def_function(
did_emsg_def += save_did_emsg_def;
failed_early:
- // Free all local variables, but not arguments.
+ // Free all arguments and local variables.
for (idx = 0; idx < ectx.ec_stack.ga_len; ++idx)
clear_tv(STACK_TV(idx));
ex_nesting_level = orig_nesting_level;