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)
diff --git a/src/dict.c b/src/dict.c
index 5581a55..051ba2f 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -951,6 +951,11 @@
}
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)
{