1
0
forked from aniani/vim

patch 8.2.2268: Vim9: list unpack seen as declaration

Problem:    Vim9: list unpack seen as declaration.
Solution:   Check for "var". (closes #7594)
This commit is contained in:
Bram Moolenaar
2021-01-01 21:05:55 +01:00
parent c368957b19
commit 3862ea3f62
7 changed files with 54 additions and 15 deletions

View File

@@ -5634,6 +5634,11 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
semsg(_(e_cannot_use_operator_on_new_variable), name);
goto theend;
}
if (!is_decl)
{
semsg(_(e_unknown_variable_str), name);
goto theend;
}
// new local variable
if ((type->tt_type == VAR_FUNC || type->tt_type == VAR_PARTIAL)
@@ -6140,6 +6145,7 @@ compile_unletlock(char_u *arg, exarg_T *eap, cctx_T *cctx)
return NULL;
}
// TODO: this doesn't work for local variables
ex_unletlock(eap, p, 0, GLV_NO_AUTOLOAD, compile_unlet, cctx);
return eap->nextcmd == NULL ? (char_u *)"" : eap->nextcmd;
}