0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.1909: Vim9: problem calling class method from other class

Problem:  Vim9: problem calling class method from other class
Solution: Fix this problem, fix readonly object access, update error
          messages.

Calling a class method from another method without the class name prefix
doesn't work properly.

A readonly object variable is modifiable outside the class using a
nested object assignment.

Remove the unused E1338 error message.

Update error messages.

closes: #13116

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-09-18 19:56:49 +02:00
committed by Christian Brabandt
parent d25021cf03
commit 00cd18222e
11 changed files with 317 additions and 159 deletions

View File

@@ -1180,14 +1180,6 @@ get_lval(
return NULL;
lp->ll_tv = &v->di_tv;
}
if (vim9script && writing && lp->ll_tv->v_type == VAR_CLASS
&& (lp->ll_tv->vval.v_class->class_flags & CLASS_INTERFACE) != 0)
{
if (!quiet)
semsg(_(e_interface_static_direct_access_str),
lp->ll_tv->vval.v_class->class_name, lp->ll_name);
return NULL;
}
if (vim9script && (flags & GLV_NO_DECL) == 0)
{