patch 8.2.4202: Vim9: cannot export function that exists globally
Problem: Vim9: cannot export function that exists globally.
Solution: When checking if a function already exists only check for
script-local functions. (closes #9615)
diff --git a/src/vim9instr.c b/src/vim9instr.c
index 493683a..b6e28b0 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -2050,7 +2050,7 @@
case ISN_NEWFUNC:
{
char_u *lambda = isn->isn_arg.newfunc.nf_lambda;
- ufunc_T *ufunc = find_func_even_dead(lambda, TRUE);
+ ufunc_T *ufunc = find_func_even_dead(lambda, FFED_IS_GLOBAL);
if (ufunc != NULL)
{