patch 8.2.0625: Vim9: confusing error when calling unknown function
Problem: Vim9: confusing error when calling unknown function.
Solution: Give error while compiling.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 393d2b8..7e1c22e 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2463,8 +2463,12 @@
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);