patch 8.2.0725: Vim9: cannot call a function declared later in Vim9 script
Problem: Vim9: cannot call a function declared later in Vim9 script.
Solution: Make two passes through the script file.
diff --git a/src/proto/evalvars.pro b/src/proto/evalvars.pro
index 58e9221..3d07a6d 100644
--- a/src/proto/evalvars.pro
+++ b/src/proto/evalvars.pro
@@ -16,6 +16,7 @@
list_T *heredoc_get(exarg_T *eap, char_u *cmd, int script_get);
void ex_let(exarg_T *eap);
void ex_const(exarg_T *eap);
+void ex_let_const(exarg_T *eap, int redefine);
int ex_let_vars(char_u *arg_start, typval_T *tv, int copy, int semicolon, int var_count, int flags, char_u *op);
char_u *skip_var_list(char_u *arg, int include_type, int *var_count, int *semicolon);
void list_hashtable_vars(hashtab_T *ht, char *prefix, int empty, int *first);
diff --git a/src/proto/scriptfile.pro b/src/proto/scriptfile.pro
index 111e855..84536ba 100644
--- a/src/proto/scriptfile.pro
+++ b/src/proto/scriptfile.pro
@@ -19,6 +19,8 @@
void ex_source(exarg_T *eap);
void ex_options(exarg_T *eap);
linenr_T *source_breakpoint(void *cookie);
+garray_T *source_get_line_ga(void *cookie);
+void source_use_line_ga(void *cookie);
int *source_dbg_tick(void *cookie);
int source_level(void *cookie);
int do_source(char_u *fname, int check_other, int is_vimrc, int *ret_sid);
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro
index 44ed397..4295ce2 100644
--- a/src/proto/userfunc.pro
+++ b/src/proto/userfunc.pro
@@ -23,7 +23,7 @@
int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe);
char_u *trans_function_name(char_u **pp, int *is_global, int skip, int flags, funcdict_T *fdp, partial_T **partial);
char_u *untrans_function_name(char_u *name);
-ufunc_T *def_function(exarg_T *eap, char_u *name_arg, void *context);
+ufunc_T *def_function(exarg_T *eap, char_u *name_arg, void *context, int compile);
void ex_function(exarg_T *eap);
int eval_fname_script(char_u *p);
int translated_function_exists(char_u *name, int is_global);
diff --git a/src/proto/vim9compile.pro b/src/proto/vim9compile.pro
index 76fca4f..6a3d9b5 100644
--- a/src/proto/vim9compile.pro
+++ b/src/proto/vim9compile.pro
@@ -9,6 +9,7 @@
char_u *to_name_const_end(char_u *arg);
int assignment_len(char_u *p, int *heredoc);
int check_vim9_unlet(char_u *name);
+int add_def_function(ufunc_T *ufunc);
void compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx);
void delete_instr(isn_T *isn);
void delete_def_function(ufunc_T *ufunc);