comparison src/evalvars.c @ 24408:96e0b898d5b4 v8.2.2744

patch 8.2.2744: Vim9: no way to explicitly ignore an argument Commit: https://github.com/vim/vim/commit/962c43bf0d6a33b905f2acd920d3701476ebb5c9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 10 17:18:09 2021 +0200 patch 8.2.2744: Vim9: no way to explicitly ignore an argument Problem: Vim9: no way to explicitly ignore an argument. Solution: Use the underscore as the name for an ignored argument.
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Apr 2021 17:30:03 +0200
parents 243985ba92b5
children 78343859f42d
comparison
equal deleted inserted replaced
24407:31c7a2a80f9c 24408:96e0b898d5b4
3186 { 3186 {
3187 vim9_declare_error(name); 3187 vim9_declare_error(name);
3188 goto failed; 3188 goto failed;
3189 } 3189 }
3190 var_in_vim9script = is_script_local && current_script_is_vim9(); 3190 var_in_vim9script = is_script_local && current_script_is_vim9();
3191 if (var_in_vim9script && name[0] == '_' && name[1] == NUL)
3192 {
3193 emsg(_(e_cannot_use_underscore_here));
3194 goto failed;
3195 }
3191 3196
3192 di = find_var_in_ht(ht, 0, varname, TRUE); 3197 di = find_var_in_ht(ht, 0, varname, TRUE);
3193 3198
3194 // Search in parent scope which is possible to reference from lambda 3199 // Search in parent scope which is possible to reference from lambda
3195 if (di == NULL) 3200 if (di == NULL)