summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-07 22:00:26 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-07 22:00:26 +0200
commitfa211f3c6d27cf962b28f10e3c18b12dde4d20c3 (patch)
treeb460743f33d1d73b20089290a296ca87a0861b76 /src/vim9compile.c
parent1c199f9c70446933677d5210f34d2b86eefa2a43 (diff)
patch 8.2.1391: Vim9: no error for shadowing a script functionv8.2.1391
Problem: Vim9: no error for shadowing a script function. Solution: Check for already defined items. (closes #6652)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index a6b4a27db8..25da7f562c 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5462,6 +5462,8 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
semsg(_(e_unknown_var), name);
goto theend;
}
+ else if (check_defined(var_start, varlen, cctx) == FAIL)
+ goto theend;
}
}