Mercurial > vim
comparison src/proto/vim9type.pro @ 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 | 57bc1001160b |
children | 374c7d5a096a |
comparison
equal
deleted
inserted
replaced
26934:2d3dd8065e25 | 26935:ccb9be1cdd71 |
---|---|
6 type_T *get_dict_type(type_T *member_type, garray_T *type_gap); | 6 type_T *get_dict_type(type_T *member_type, garray_T *type_gap); |
7 type_T *alloc_func_type(type_T *ret_type, int argcount, garray_T *type_gap); | 7 type_T *alloc_func_type(type_T *ret_type, int argcount, garray_T *type_gap); |
8 type_T *get_func_type(type_T *ret_type, int argcount, garray_T *type_gap); | 8 type_T *get_func_type(type_T *ret_type, int argcount, garray_T *type_gap); |
9 int func_type_add_arg_types(type_T *functype, int argcount, garray_T *type_gap); | 9 int func_type_add_arg_types(type_T *functype, int argcount, garray_T *type_gap); |
10 int need_convert_to_bool(type_T *type, typval_T *tv); | 10 int need_convert_to_bool(type_T *type, typval_T *tv); |
11 type_T *typval2type(typval_T *tv, int copyID, garray_T *type_gap, int do_member); | 11 type_T *typval2type(typval_T *tv, int copyID, garray_T *type_gap, int flags); |
12 type_T *typval2type_vimvar(typval_T *tv, garray_T *type_gap); | 12 type_T *typval2type_vimvar(typval_T *tv, garray_T *type_gap); |
13 int check_typval_arg_type(type_T *expected, typval_T *actual_tv, char *func_name, int arg_idx); | 13 int check_typval_arg_type(type_T *expected, typval_T *actual_tv, char *func_name, int arg_idx); |
14 int check_typval_type(type_T *expected, typval_T *actual_tv, where_T where); | 14 int check_typval_type(type_T *expected, typval_T *actual_tv, where_T where); |
15 void type_mismatch(type_T *expected, type_T *actual); | 15 void type_mismatch(type_T *expected, type_T *actual); |
16 void arg_type_mismatch(type_T *expected, type_T *actual, int arg_idx); | 16 void arg_type_mismatch(type_T *expected, type_T *actual, int arg_idx); |
20 int check_argument_types(type_T *type, typval_T *argvars, int argcount, char_u *name); | 20 int check_argument_types(type_T *type, typval_T *argvars, int argcount, char_u *name); |
21 char_u *skip_type(char_u *start, int optional); | 21 char_u *skip_type(char_u *start, int optional); |
22 type_T *parse_type(char_u **arg, garray_T *type_gap, int give_error); | 22 type_T *parse_type(char_u **arg, garray_T *type_gap, int give_error); |
23 int equal_type(type_T *type1, type_T *type2, int flags); | 23 int equal_type(type_T *type1, type_T *type2, int flags); |
24 void common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap); | 24 void common_type(type_T *type1, type_T *type2, type_T **dest, garray_T *type_gap); |
25 type_T *get_member_type_from_stack(type_T **stack_top, int count, int skip, garray_T *type_gap); | 25 int push_type_stack(cctx_T *cctx, type_T *type); |
26 int push_type_stack2(cctx_T *cctx, type_T *type, type_T *decl_type); | |
27 void set_type_on_stack(cctx_T *cctx, type_T *type, int offset); | |
28 type_T *get_type_on_stack(cctx_T *cctx, int offset); | |
29 type_T *get_member_type_from_stack(int count, int skip, type_T **decl_type, cctx_T *cctx); | |
26 char *vartype_name(vartype_T type); | 30 char *vartype_name(vartype_T type); |
27 char *type_name(type_T *type, char **tofree); | 31 char *type_name(type_T *type, char **tofree); |
28 void f_typename(typval_T *argvars, typval_T *rettv); | 32 void f_typename(typval_T *argvars, typval_T *rettv); |
29 /* vim: set ft=c : */ | 33 /* vim: set ft=c : */ |