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.
diff --git a/src/userfunc.c b/src/userfunc.c
index 6a5d84b..ce2ad13 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -429,6 +429,12 @@
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;
}
}
}