From acc4b5648b49ec13c4f35ee0bf552eda71b0c372 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 24 Jan 2022 13:54:45 +0000 Subject: 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) --- src/vim9compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vim9compile.c') diff --git a/src/vim9compile.c b/src/vim9compile.c index 2b706ad18..9ad1e7ddc 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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 -- cgit v1.2.1