summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-15 21:41:56 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-15 21:41:56 +0100
commit9987fb0b4b591e6450fb1dfbe8f615f365057f2a (patch)
tree934e6a83812494bf39b91c168935636c70bf9492 /src/dict.c
parent399ea8108c8da3fcdf5d738a0f8eae67155b4b10 (diff)
downloadvim-git-9987fb0b4b591e6450fb1dfbe8f615f365057f2a.tar.gz
patch 8.2.2146: Vim9: automatic conversion of number to string for dict keyv8.2.2146
Problem: Vim9: automatic conversion of number to string for dict key. Solution: Do not convert number to string. (closes #7474)
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dict.c b/src/dict.c
index 5581a5571..051ba2f6e 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -951,6 +951,11 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
}
if (evaluate)
{
+ if (vim9script && check_for_string(&tvkey) == FAIL)
+ {
+ clear_tv(&tvkey);
+ goto failret;
+ }
key = tv_get_string_buf_chk(&tvkey, buf);
if (key == NULL)
{