0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1355: no error when declaring a class twice

Problem:    No error when declaring a class twice. (Ernie Rael)
Solution:   Pass different flags when declaring the class. (closes #12057)
This commit is contained in:
Bram Moolenaar
2023-02-25 19:59:31 +00:00
parent d6a4ea3aa0
commit 83ae6150bf
3 changed files with 29 additions and 4 deletions

View File

@@ -230,7 +230,8 @@ object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl)
void
ex_class(exarg_T *eap)
{
int is_class = eap->cmdidx == CMD_class; // FALSE for :interface
int is_class = eap->cmdidx == CMD_class; // FALSE for :interface
long start_lnum = SOURCING_LNUM;
char_u *arg = eap->arg;
int is_abstract = eap->cmdidx == CMD_abstract;
@@ -1097,8 +1098,9 @@ early_ret:
tv.v_type = VAR_CLASS;
tv.vval.v_class = cl;
is_export = class_export;
SOURCING_LNUM = start_lnum;
set_var_const(cl->class_name, current_sctx.sc_sid,
NULL, &tv, FALSE, ASSIGN_DECL, 0);
NULL, &tv, FALSE, 0, 0);
return;
}