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:
@@ -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
|
||||
|
Reference in New Issue
Block a user