Skip to content

Commit

Permalink
patch 8.2.3996: Vim9: type checking lacks information about declared …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
brammool committed Jan 4, 2022
1 parent 9acf2d8 commit 078a461
Show file tree
Hide file tree
Showing 17 changed files with 464 additions and 365 deletions.
5 changes: 3 additions & 2 deletions src/dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions src/evalbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,6 @@ f_getbufline(typval_T *argvars, typval_T *rettv)
get_buffer_lines(buf, lnum, end, TRUE, rettv);
}

type_T *
ret_f_getline(int argcount, type_T **argtypes UNUSED)
{
return argcount == 1 ? &t_string : &t_list_string;
}

/*
* "getline(lnum, [end])" function
*/
Expand Down

0 comments on commit 078a461

Please sign in to comment.