Skip to content

Commit 6f0ddbf

Browse files
committed
patch 8.2.4164: error in legacy code for function shadowing variable
Problem: Error in legacy code for function shadowing variable. Solution: Only give the error in Vim9 script.
1 parent 2017d6f commit 6f0ddbf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/userfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4466,7 +4466,7 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
44664466
int var_conflict = FALSE;
44674467

44684468
v = find_var(name, &ht, TRUE);
4469-
if (v != NULL)
4469+
if (v != NULL && (in_vim9script() || v->di_tv.v_type == VAR_FUNC))
44704470
var_conflict = TRUE;
44714471

44724472
if (SCRIPT_ID_VALID(current_sctx.sc_sid))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
4164,
753755
/**/
754756
4163,
755757
/**/

0 commit comments

Comments
 (0)