diff src/evalvars.c @ 19530:48e71f948360 v8.2.0322

patch 8.2.0322: Vim9: error checks not tested Commit: https://github.com/vim/vim/commit/b35efa5ed040162f5c988c71dfc1159045e47585 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 26 20:15:18 2020 +0100 patch 8.2.0322: Vim9: error checks not tested Problem: Vim9: error checks not tested. Solution: Add more test cases. Avoid error for function loaded later.
author Bram Moolenaar <Bram@vim.org>
date Wed, 26 Feb 2020 20:30:09 +0100
parents 4a6a412e4565
children fe827d6267c2
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2541,8 +2541,10 @@ find_var_ht(char_u *name, char_u **varna
 	return &curtab->tp_vars->dv_hashtab;
     if (*name == 'v')				// v: variable
 	return &vimvarht;
-    if (current_sctx.sc_version != SCRIPT_VERSION_VIM9)
+    if (get_current_funccal() != NULL
+			      && get_current_funccal()->func->uf_dfunc_idx < 0)
     {
+	// a: and l: are only used in functions defined with ":function"
 	if (*name == 'a')			// a: function argument
 	    return get_funccal_args_ht();
 	if (*name == 'l')			// l: local function variable