0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-08-16 22:22:31 +02:00
parent 9c272a9e52
commit 9174639a82
5 changed files with 21 additions and 4 deletions

View File

@@ -1113,8 +1113,10 @@ call_internal_method(
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)