comparison src/vim9compile.c @ 23068:2f034cb0a046 v8.2.2080

patch 8.2.2080: Vim9: no proper error message for using s:var in for loop Commit: https://github.com/vim/vim/commit/ea87069d7814497181483877651aef6d97182120 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 2 14:24:30 2020 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Dec 2020 14:30:03 +0100
parents b3124656f050
children 6a70803f4cbe
comparison
equal deleted inserted replaced
23067:d65e8d80869b 23068:2f034cb0a046
6612 { 6612 {
6613 var_lvar = lookup_local(arg, varlen, cctx); 6613 var_lvar = lookup_local(arg, varlen, cctx);
6614 if (var_lvar != NULL) 6614 if (var_lvar != NULL)
6615 { 6615 {
6616 semsg(_(e_variable_already_declared), arg); 6616 semsg(_(e_variable_already_declared), arg);
6617 goto failed;
6618 }
6619
6620 if (STRNCMP(name, "s:", 2) == 0)
6621 {
6622 semsg(_(e_cannot_declare_script_variable_in_function), name);
6617 goto failed; 6623 goto failed;
6618 } 6624 }
6619 6625
6620 // Reserve a variable to store "var". 6626 // Reserve a variable to store "var".
6621 // TODO: check for type 6627 // TODO: check for type