patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded
Problem: Vim9: compiling function fails when autoload script is not loaded
yet.
Solution: Depend on runtime loading.
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 8ce32a7..48b22a6 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -714,7 +714,6 @@
/*
* Generate an ISN_PUSHFUNC instruction with name "name".
- * Consumes "name".
*/
int
generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
@@ -727,7 +726,8 @@
return FAIL;
if (name == NULL)
funcname = NULL;
- else if (*name == K_SPECIAL) // script-local
+ else if (*name == K_SPECIAL // script-local
+ || vim_strchr(name, AUTOLOAD_CHAR) != NULL) // autoload
funcname = vim_strsave(name);
else
{