From 9987fb0b4b591e6450fb1dfbe8f615f365057f2a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Dec 2020 21:41:56 +0100 Subject: patch 8.2.2146: Vim9: automatic conversion of number to string for dict key Problem: Vim9: automatic conversion of number to string for dict key. Solution: Do not convert number to string. (closes #7474) --- src/dict.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dict.c') diff --git a/src/dict.c b/src/dict.c index 5581a5571b..051ba2f6ec 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) { -- cgit v1.2.3