summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-05 14:05:51 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-05 14:05:51 +0000
commite0c2b2ceaa8ca2d0f412f17f4cf14fb4f7a3296f (patch)
treeaaf24425b3e4d43316647169685b66b5df3e8bf5 /src/dict.c
parent4fa1346bf4210747f34b64d05b39309918ca538d (diff)
patch 8.2.4301: Vim9: type error for copy of dictv8.2.4301
Problem: Vim9: type error for copy of dict. Solution: Do not use dict<any> but no type. (closes #9696)
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dict.c b/src/dict.c
index 06f38716b5..c2dc6a7c23 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -306,7 +306,10 @@ dict_copy(dict_T *orig, int deep, int top, int copyID)
orig->dv_copyID = copyID;
orig->dv_copydict = copy;
}
- copy->dv_type = alloc_type(top || deep ? &t_dict_any : orig->dv_type);
+ if (orig->dv_type == NULL || top || deep)
+ copy->dv_type = NULL;
+ else
+ copy->dv_type = alloc_type(orig->dv_type);
todo = (int)orig->dv_hashtab.ht_used;
for (hi = orig->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi)