summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorErnie Rael <errael@raelity.com>2023-12-14 20:06:39 +0100
committerChristian Brabandt <cb@256bit.org>2023-12-14 20:06:39 +0100
commitfa831102c38c9192edf3aaf0cbcaff9ee5e006ac (patch)
tree6643f2b8d5784dd0b9571fe9a53590a2102524a5 /src/dict.c
parent2a71b54d35361f3f0c24db88c672b426f8acc7b7 (diff)
patch 9.0.2163: Vim9: type can be assigned to list/dictv9.0.2163
Problem: Vim9: type can be assigned to list/dict Solution: Prevent assigning a `type` to a `list` or `dict` closes: #13683 Signed-off-by: Ernie Rael <errael@raelity.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dict.c b/src/dict.c
index ce807350cd..cb22b42c91 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1015,6 +1015,15 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
clear_tv(&tvkey);
goto failret;
}
+ if (check_typval_is_value(&tv) == FAIL)
+ {
+ if (evaluate)
+ {
+ clear_tv(&tvkey);
+ clear_tv(&tv);
+ }
+ goto failret;
+ }
if (evaluate)
{
item = dict_find(d, key, -1);