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

patch 9.0.1211: storing value in interface member does not always work

Problem:    Storing value in interface member does not always work.
Solution:   Convert the index on the interface to the index on the object.
This commit is contained in:
Bram Moolenaar
2023-01-16 20:47:57 +00:00
parent b391e1f805
commit f7d1c6e188
6 changed files with 44 additions and 8 deletions

View File

@@ -2178,7 +2178,22 @@ compile_assign_unlet(
if (isn == NULL)
return FAIL;
isn->isn_arg.vartype = dest_type;
isn->isn_arg.storeindex.si_vartype = dest_type;
isn->isn_arg.storeindex.si_class = NULL;
if (dest_type == VAR_OBJECT)
{
class_T *cl = (class_T *)lhs->lhs_type->tt_member;
if (cl->class_flags & CLASS_INTERFACE)
{
// "this.value": load "this" object and get the value
// at index for an object or class member get the type
// of the member
isn->isn_arg.storeindex.si_class = cl;
++cl->class_refcount;
}
}
}
}
else if (range)