diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-23 18:13:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-23 18:13:23 +0200 |
commit | 1df8b3fb04ce8732a0be680273c95eb4e9f5e85d (patch) | |
tree | 7beae0ff7191aac51a9ac83ba04226296f9fb6ec /src/vim9compile.c | |
parent | a72cfb80cd7aa589ad2a4fb8766ed6d30ea8ae33 (diff) | |
download | vim-git-1df8b3fb04ce8732a0be680273c95eb4e9f5e85d.tar.gz |
patch 8.2.0625: Vim9: confusing error when calling unknown functionv8.2.0625
Problem: Vim9: confusing error when calling unknown function.
Solution: Give error while compiling.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index 393d2b824..7e1c22e8b 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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); |