comparison src/evalfunc.c @ 17732:1726c2db81bf v8.1.1863

patch 8.1.1863: confusing error when using a builtin function as method commit https://github.com/vim/vim/commit/9174639a82799011cfa0013cbc4c4709b3833bf0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 16 22:22:31 2019 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Aug 2019 22:30:04 +0200
parents 68ea27d26d5b
children 4a3dca734d36
comparison
equal deleted inserted replaced
17731:314da6ab06bd 17732:1726c2db81bf
1111 int i; 1111 int i;
1112 int fi; 1112 int fi;
1113 typval_T argv[MAX_FUNC_ARGS + 1]; 1113 typval_T argv[MAX_FUNC_ARGS + 1];
1114 1114
1115 fi = find_internal_func(name); 1115 fi = find_internal_func(name);
1116 if (fi < 0 || global_functions[fi].f_argtype == 0) 1116 if (fi < 0)
1117 return ERROR_UNKNOWN; 1117 return ERROR_UNKNOWN;
1118 if (global_functions[fi].f_argtype == 0)
1119 return ERROR_NOTMETHOD;
1118 if (argcount + 1 < global_functions[fi].f_min_argc) 1120 if (argcount + 1 < global_functions[fi].f_min_argc)
1119 return ERROR_TOOFEW; 1121 return ERROR_TOOFEW;
1120 if (argcount + 1 > global_functions[fi].f_max_argc) 1122 if (argcount + 1 > global_functions[fi].f_max_argc)
1121 return ERROR_TOOMANY; 1123 return ERROR_TOOMANY;
1122 1124