0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1060: private and public object members are not implemented yet

problem:    Private and public object members are not implemented yet.
Solution:   Implement private and public object members.
This commit is contained in:
Bram Moolenaar
2022-12-14 20:59:32 +00:00
parent f94178db8d
commit 3d473ee1a6
7 changed files with 144 additions and 12 deletions

View File

@@ -281,6 +281,13 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type)
objmember_T *m = &cl->class_obj_members[i];
if (STRNCMP(name, m->om_name, len) == 0 && m->om_name[len] == NUL)
{
if (*name == '_' && cctx->ctx_ufunc->uf_class != cl)
{
semsg(_(e_cannot_access_private_object_member_str),
m->om_name);
return FAIL;
}
generate_GET_OBJ_MEMBER(cctx, i, m->om_type);
*arg = name_end;