Mercurial > vim
diff src/dict.c @ 26935:ccb9be1cdd71 v8.2.3996
patch 8.2.3996: Vim9: type checking lacks information about declared type
Commit: https://github.com/vim/vim/commit/078a46161e8b1b30bf306d6c1f4f0af7c616a989
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 4 15:17:03 2022 +0000
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 04 Jan 2022 16:30:06 +0100 |
parents | 7f150a4936f2 |
children | 7045e9308ca3 |
line wrap: on
line diff
--- a/src/dict.c +++ b/src/dict.c @@ -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;