1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2022-01-24 13:54:45 +00:00
parent 8e4af851fd
commit acc4b5648b
7 changed files with 58 additions and 12 deletions

View File

@@ -332,7 +332,7 @@ check_defined(char_u *p, size_t len, cctx_T *cctx, int is_arg)
&& (lookup_local(p, len, NULL, cctx) == OK
|| arg_exists(p, len, NULL, NULL, NULL, cctx) == OK))
|| find_imported(p, len, FALSE, cctx) != NULL
|| (ufunc = find_func_even_dead(p, FALSE)) != NULL)
|| (ufunc = find_func_even_dead(p, 0)) != NULL)
{
// A local or script-local function can shadow a global function.
if (ufunc == NULL || ((ufunc->uf_flags & FC_DEAD) == 0