0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1730: Vim9: cannot use member of unknown type

Problem:    Vim9: cannot use member of unknown type.
Solution:   When type is unknown us "any". (closes #6997)
This commit is contained in:
Bram Moolenaar
2020-09-23 13:25:32 +02:00
parent 189832bf66
commit 04bdd573d0
3 changed files with 32 additions and 1 deletions

View File

@@ -5080,12 +5080,14 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
}
else
{
// An empty list or dict has a &t_void member,
// An empty list or dict has a &t_unknown member,
// for a variable that implies &t_any.
if (stacktype == &t_list_empty)
lvar->lv_type = &t_list_any;
else if (stacktype == &t_dict_empty)
lvar->lv_type = &t_dict_any;
else if (stacktype == &t_unknown)
lvar->lv_type = &t_any;
else
lvar->lv_type = stacktype;
}