1
0
forked from aniani/vim

patch 9.0.1179: not all errors around inheritance are tested

Problem:    Not all errors around inheritance are tested.
Solution:   Add more tests.  Fix uncovered problems.
This commit is contained in:
Bram Moolenaar
2023-01-11 17:59:38 +00:00
parent 58b40092e6
commit 6aa0937fb8
5 changed files with 82 additions and 6 deletions

View File

@@ -268,14 +268,14 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type)
if (type == &t_super)
{
if (cctx->ctx_ufunc == NULL || cctx->ctx_ufunc->uf_class == NULL)
emsg(_(e_using_super_not_in_class_function));
else
{
is_super = TRUE;
cl = cctx->ctx_ufunc->uf_class;
// Remove &t_super from the stack.
--cctx->ctx_type_stack.ga_len;
emsg(_(e_using_super_not_in_class_function));
return FAIL;
}
is_super = TRUE;
cl = cctx->ctx_ufunc->uf_class;
// Remove &t_super from the stack.
--cctx->ctx_type_stack.ga_len;
}
else if (type->tt_type == VAR_CLASS)
{
@@ -2261,6 +2261,7 @@ compile_subscript(
// class constructor: SomeClass.new()
// object member: someObject.varname, this.varname
// object method: someObject.SomeMethod(), this.SomeMethod()
*arg = p;
if (compile_class_object_index(cctx, arg, type) == FAIL)
return FAIL;
}