mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4310: Vim9: constant list and dict get a declaration type
Problem: Vim9: constant list and dict get a declaration type other than "any". Solution: A constant list and dict have a declared member type "any". (closes #9701)
This commit is contained in:
@@ -1067,7 +1067,6 @@ generate_NEWLIST(cctx_T *cctx, int count)
|
||||
{
|
||||
isn_T *isn;
|
||||
type_T *member_type;
|
||||
type_T *decl_member_type;
|
||||
type_T *type;
|
||||
type_T *decl_type;
|
||||
|
||||
@@ -1078,10 +1077,9 @@ generate_NEWLIST(cctx_T *cctx, int count)
|
||||
|
||||
// Get the member type and the declared member type from all the items on
|
||||
// the stack.
|
||||
member_type = get_member_type_from_stack(count, 1,
|
||||
&decl_member_type, cctx);
|
||||
member_type = get_member_type_from_stack(count, 1, cctx);
|
||||
type = get_list_type(member_type, cctx->ctx_type_list);
|
||||
decl_type = get_list_type(decl_member_type, cctx->ctx_type_list);
|
||||
decl_type = get_list_type(&t_any, cctx->ctx_type_list);
|
||||
|
||||
// drop the value types
|
||||
cctx->ctx_type_stack.ga_len -= count;
|
||||
@@ -1098,7 +1096,6 @@ generate_NEWDICT(cctx_T *cctx, int count)
|
||||
{
|
||||
isn_T *isn;
|
||||
type_T *member_type;
|
||||
type_T *decl_member_type;
|
||||
type_T *type;
|
||||
type_T *decl_type;
|
||||
|
||||
@@ -1107,10 +1104,9 @@ generate_NEWDICT(cctx_T *cctx, int count)
|
||||
return FAIL;
|
||||
isn->isn_arg.number = count;
|
||||
|
||||
member_type = get_member_type_from_stack(count, 2,
|
||||
&decl_member_type, cctx);
|
||||
member_type = get_member_type_from_stack(count, 2, cctx);
|
||||
type = get_dict_type(member_type, cctx->ctx_type_list);
|
||||
decl_type = get_dict_type(decl_member_type, cctx->ctx_type_list);
|
||||
decl_type = get_dict_type(&t_any, cctx->ctx_type_list);
|
||||
|
||||
// drop the key and value types
|
||||
cctx->ctx_type_stack.ga_len -= 2 * count;
|
||||
|
Reference in New Issue
Block a user