0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.0625: Vim9: confusing error when calling unknown function

Problem:    Vim9: confusing error when calling unknown function.
Solution:   Give error while compiling.
This commit is contained in:
Bram Moolenaar
2020-04-23 18:13:23 +02:00
parent a72cfb80cd
commit 1df8b3fb04
4 changed files with 40 additions and 18 deletions

View File

@@ -2463,8 +2463,12 @@ compile_call(char_u **arg, size_t varlen, cctx_T *cctx, int argcount_init)
goto theend;
}
// The function may be defined only later. Need to figure out at runtime.
res = generate_UCALL(cctx, name, argcount);
// A global function may be defined only later. Need to figure out at
// runtime.
if (STRNCMP(namebuf, "g:", 2) == 0)
res = generate_UCALL(cctx, name, argcount);
else
semsg(_(e_unknownfunc), namebuf);
theend:
vim_free(tofree);