patch 8.2.3996: Vim9: type checking lacks information about declared type
Problem: Vim9: type checking for list and dict lacks information about
declared type.
Solution: Add dv_decl_type and lv_decl_type. Refactor the type stack to
store two types in each entry.
diff --git a/src/dict.c b/src/dict.c
index b3cdfd9..27cde11 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -109,6 +109,8 @@
hashtab_free_contents(&d->dv_hashtab);
free_type(d->dv_type);
d->dv_type = NULL;
+ free_type(d->dv_decl_type);
+ d->dv_decl_type = NULL;
}
/*
@@ -1354,8 +1356,7 @@
if (filtermap == FILTERMAP_MAP)
{
if (argtype != NULL && check_typval_arg_type(
- argtype->tt_member, &newtv,
- func_name, 0) == FAIL)
+ argtype->tt_member, &newtv, func_name, 0) == FAIL)
{
clear_tv(&newtv);
break;