patch 9.0.2163: Vim9: type can be assigned to list/dict
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>
diff --git a/src/list.c b/src/list.c
index ce1ccaa..b50cb03 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1576,6 +1576,12 @@
{
if (eval1(arg, &tv, evalarg) == FAIL) // recursive!
goto failret;
+ if (check_typval_is_value(&tv) == FAIL)
+ {
+ if (evaluate)
+ clear_tv(&tv);
+ goto failret;
+ }
if (evaluate)
{
item = listitem_alloc();