comparison src/vim9compile.c @ 20840:0600ab7b9f09 v8.2.0972

patch 8.2.0972: Vim9 script variable declarations need a type Commit: https://github.com/vim/vim/commit/c82a5b5da5eab15bc35115545b639fb590272ad7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 13 18:09:19 2020 +0200 patch 8.2.0972: Vim9 script variable declarations need a type Problem: Vim9 script variable declarations need a type. Solution: Make "let var: type" declare a script-local variable.
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Jun 2020 18:15:03 +0200
parents 9064044fd4f6
children bacc2ab11810
comparison
equal deleted inserted replaced
20839:7c1e92b152ed 20840:0600ab7b9f09
2253 } 2253 }
2254 return -1; 2254 return -1;
2255 } 2255 }
2256 2256
2257 /* 2257 /*
2258 * Find "name" in imported items of the current script/ 2258 * Find "name" in imported items of the current script or in "cctx" if not
2259 * NULL.
2259 */ 2260 */
2260 imported_T * 2261 imported_T *
2261 find_imported(char_u *name, size_t len, cctx_T *cctx) 2262 find_imported(char_u *name, size_t len, cctx_T *cctx)
2262 { 2263 {
2263 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); 2264 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
5010 goto theend; 5011 goto theend;
5011 } 5012 }
5012 } 5013 }
5013 else if (cmdidx == CMD_const) 5014 else if (cmdidx == CMD_const)
5014 { 5015 {
5015 emsg(_("E1021: const requires a value")); 5016 emsg(_(e_const_req_value));
5016 goto theend; 5017 goto theend;
5017 } 5018 }
5018 else if (!has_type || dest == dest_option) 5019 else if (!has_type || dest == dest_option)
5019 { 5020 {
5020 emsg(_("E1022: type or initialization required")); 5021 emsg(_(e_type_req));
5021 goto theend; 5022 goto theend;
5022 } 5023 }
5023 else 5024 else
5024 { 5025 {
5025 // variables are always initialized 5026 // variables are always initialized