patch 9.0.0502: a closure in a nested loop in a :def function does not work
Problem: A closure in a nested loop in a :def function does not work.
Solution: Use an array of loopvars, one per loop level.
diff --git a/src/proto/vim9cmds.pro b/src/proto/vim9cmds.pro
index a0c3ade..4d9e983 100644
--- a/src/proto/vim9cmds.pro
+++ b/src/proto/vim9cmds.pro
@@ -11,8 +11,8 @@
char_u *compile_endfor(char_u *arg, cctx_T *cctx);
char_u *compile_while(char_u *arg, cctx_T *cctx);
char_u *compile_endwhile(char_u *arg, cctx_T *cctx);
-short get_loop_var_info(cctx_T *cctx, short *loop_var_idx);
-int get_loop_var_idx(cctx_T *cctx);
+int get_loop_var_info(cctx_T *cctx, loopvarinfo_T *lvi);
+void get_loop_var_idx(cctx_T *cctx, int idx, lvar_T *lvar);
char_u *compile_continue(char_u *arg, cctx_T *cctx);
char_u *compile_break(char_u *arg, cctx_T *cctx);
char_u *compile_block(char_u *arg, cctx_T *cctx);