mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.2080: Vim9: no proper error message for using s:var in for loop
Problem: Vim9: no proper error message for using s:var in for loop. Solution: Give a specific error.
This commit is contained in:
@@ -6617,6 +6617,12 @@ compile_for(char_u *arg_start, cctx_T *cctx)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (STRNCMP(name, "s:", 2) == 0)
|
||||
{
|
||||
semsg(_(e_cannot_declare_script_variable_in_function), name);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
// Reserve a variable to store "var".
|
||||
// TODO: check for type
|
||||
var_lvar = reserve_local(cctx, arg, varlen, FALSE, &t_any);
|
||||
|
Reference in New Issue
Block a user