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.
This commit is contained in:
Bram Moolenaar
2022-01-04 15:17:03 +00:00
parent 9acf2d8be9
commit 078a46161e
17 changed files with 464 additions and 365 deletions

View File

@ -109,6 +109,8 @@ dict_free_contents(dict_T *d)
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 @@ dict_filter_map(
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;