0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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

@@ -49,6 +49,20 @@ lookup_local(char_u *name, size_t len, lvar_T *lvar, cctx_T *cctx)
&& (cctx->ctx_ufunc->uf_flags & (FC_OBJECT|FC_NEW)))
{
int is_super = *name == 's';
if (is_super)
{
if (name[5] != '.')
{
emsg(_(e_super_must_be_followed_by_dot));
return FAIL;
}
if (cctx->ctx_ufunc->uf_class != NULL
&& cctx->ctx_ufunc->uf_class->class_extends == NULL)
{
emsg(_(e_using_super_not_in_child_class));
return FAIL;
}
}
if (lvar != NULL)
{
CLEAR_POINTER(lvar);