1
0
forked from aniani/vim

patch 9.0.1822: Vim9: no check for duplicate members in extended classes

Problem:  Vim9: no check for duplicate members in extended classes
Solution: Check for duplicate members in extended classes.
          Fix memory leak.

closes: #12948

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-08-29 22:32:02 +02:00
committed by Christian Brabandt
parent 4b9777a1df
commit e3b6c78ddc
6 changed files with 216 additions and 57 deletions

View File

@@ -372,7 +372,7 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type)
return FAIL;
}
if (ufunc->uf_private && !inside_class_hierarchy(cctx, cl))
if (*ufunc->uf_name == '_' && !inside_class_hierarchy(cctx, cl))
{
semsg(_(e_cannot_access_private_method_str), name);
return FAIL;