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

patch 8.2.2209: Vim9: return type of => lambda not parsed

Problem:    Vim9: return type of => lambda not parsed.
Solution:   Parse and use the return type.
This commit is contained in:
Bram Moolenaar
2020-12-25 12:38:04 +01:00
parent 4aab88d919
commit 9e68c32563
8 changed files with 125 additions and 69 deletions

View File

@@ -511,7 +511,6 @@ vim9_declare_scriptvar(exarg_T *eap, char_u *arg)
char_u *name;
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
type_T *type;
int called_emsg_before = called_emsg;
typval_T init_tv;
if (eap->cmdidx == CMD_final || eap->cmdidx == CMD_const)
@@ -548,8 +547,8 @@ vim9_declare_scriptvar(exarg_T *eap, char_u *arg)
// parse type
p = skipwhite(p + 1);
type = parse_type(&p, &si->sn_type_list);
if (called_emsg != called_emsg_before)
type = parse_type(&p, &si->sn_type_list, TRUE);
if (type == NULL)
{
vim_free(name);
return p;