patch 8.2.4612: Vim9: cannot use a recursive call in a nested function
Problem: Vim9: cannot use a recursive call in a nested function. (Sergey
Vlasov)
Solution: Define the funcref before compiling the function. (closes #9989)
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 3a329cc..8c7d0b0e 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -1040,7 +1040,7 @@
// The function reference count will be 1. When the ISN_FUNCREF
// instruction is deleted the reference count is decremented and the
// function is freed.
- return generate_FUNCREF(cctx, ufunc);
+ return generate_FUNCREF(cctx, ufunc, NULL);
}
func_ptr_unref(ufunc);