patch 9.0.2096: Vim9: confusing usage of private
Problem: Vim9: confusing usage of private
Solution: clarify and use protected keyword instead
[vim9class] document `_` as protected instead of private
fixes #13504
closes: #13520
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8a44376..5bd8907 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1617,7 +1617,7 @@
|| (!is_object && cctx->ctx_ufunc->uf_class != cl)))
{
char *msg = (m->ocm_access == VIM_ACCESS_PRIVATE)
- ? e_cannot_access_private_variable_str
+ ? e_cannot_access_protected_variable_str
: e_variable_is_not_writable_str;
emsg_var_cl_define(msg, m->ocm_name, 0, cl);
return FALSE;
@@ -2034,8 +2034,8 @@
|| (!is_object && cctx->ctx_ufunc->uf_class != cl)))
{
char *msg = (m->ocm_access == VIM_ACCESS_PRIVATE)
- ? e_cannot_access_private_variable_str
- : e_variable_is_not_writable_str;
+ ? e_cannot_access_protected_variable_str
+ : e_variable_is_not_writable_str;
emsg_var_cl_define(msg, m->ocm_name, 0, cl);
return FAIL;
}