patch 8.1.1863: confusing error when using a builtin function as method
Problem: Confusing error when using a builtin function as method while it
does not support that.
Solution: Add a specific error message.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 8144993..7d46f35 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1113,8 +1113,10 @@
typval_T argv[MAX_FUNC_ARGS + 1];
fi = find_internal_func(name);
- if (fi < 0 || global_functions[fi].f_argtype == 0)
+ if (fi < 0)
return ERROR_UNKNOWN;
+ if (global_functions[fi].f_argtype == 0)
+ return ERROR_NOTMETHOD;
if (argcount + 1 < global_functions[fi].f_min_argc)
return ERROR_TOOFEW;
if (argcount + 1 > global_functions[fi].f_max_argc)