comparison src/vim9compile.c @ 23450:a8e7acf71fa4 v8.2.2268

patch 8.2.2268: Vim9: list unpack seen as declaration Commit: https://github.com/vim/vim/commit/3862ea3f620f02569c2d816ca9ceeeac3a0ad901 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 1 21:05:55 2021 +0100 patch 8.2.2268: Vim9: list unpack seen as declaration Problem: Vim9: list unpack seen as declaration. Solution: Check for "var". (closes https://github.com/vim/vim/issues/7594)
author Bram Moolenaar <Bram@vim.org>
date Fri, 01 Jan 2021 21:15:04 +0100
parents b1dbbc81a011
children d2b1269c2c68
comparison
equal deleted inserted replaced
23449:f04821549e6f 23450:a8e7acf71fa4
5632 { 5632 {
5633 // +=, /=, etc. require an existing variable 5633 // +=, /=, etc. require an existing variable
5634 semsg(_(e_cannot_use_operator_on_new_variable), name); 5634 semsg(_(e_cannot_use_operator_on_new_variable), name);
5635 goto theend; 5635 goto theend;
5636 } 5636 }
5637 if (!is_decl)
5638 {
5639 semsg(_(e_unknown_variable_str), name);
5640 goto theend;
5641 }
5637 5642
5638 // new local variable 5643 // new local variable
5639 if ((type->tt_type == VAR_FUNC || type->tt_type == VAR_PARTIAL) 5644 if ((type->tt_type == VAR_FUNC || type->tt_type == VAR_PARTIAL)
5640 && var_wrong_func_name(name, TRUE)) 5645 && var_wrong_func_name(name, TRUE))
5641 goto theend; 5646 goto theend;
6138 { 6143 {
6139 emsg("Sorry, :lock and unlock not implemented yet"); 6144 emsg("Sorry, :lock and unlock not implemented yet");
6140 return NULL; 6145 return NULL;
6141 } 6146 }
6142 6147
6148 // TODO: this doesn't work for local variables
6143 ex_unletlock(eap, p, 0, GLV_NO_AUTOLOAD, compile_unlet, cctx); 6149 ex_unletlock(eap, p, 0, GLV_NO_AUTOLOAD, compile_unlet, cctx);
6144 return eap->nextcmd == NULL ? (char_u *)"" : eap->nextcmd; 6150 return eap->nextcmd == NULL ? (char_u *)"" : eap->nextcmd;
6145 } 6151 }
6146 6152
6147 /* 6153 /*