diff src/userfunc.c @ 28123:e5fcd1256ee3 v8.2.4586

patch 8.2.4586: Vim9: no error for using lower case name for "func" argument Commit: https://github.com/vim/vim/commit/1d9cef769d6c91d9a58a9c3c1c8ffe3da3570871 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 17 16:30:03 2022 +0000 patch 8.2.4586: Vim9: no error for using lower case name for "func" argument Problem: Vim9: no error for using lower case name for "func" argument. (Ernie Rael) Solution: Check the name as soon as the type is known.
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Mar 2022 17:45:03 +0100
parents b10fa9b17c85
children 4b322951ebac
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -429,6 +429,12 @@ parse_argument_types(ufunc_T *fp, garray
 		if (type == NULL)
 		    return FAIL;
 		fp->uf_arg_types[i] = type;
+		if (i < fp->uf_args.ga_len
+			&& (type->tt_type == VAR_FUNC
+			    || type->tt_type == VAR_PARTIAL)
+			&& var_wrong_func_name(
+				    ((char_u **)fp->uf_args.ga_data)[i], TRUE))
+		    return FAIL;
 	    }
 	}
     }