summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0a2b0689d2..c6b02478ce 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1790,10 +1790,11 @@ compile_lhs(
return FAIL;
lhs->lhs_dest = dest_class_member;
- lhs->lhs_class = cctx->ctx_ufunc->uf_class;
- lhs->lhs_type =
- oc_member_type_by_idx(cctx->ctx_ufunc->uf_class,
- FALSE, lhs->lhs_classmember_idx);
+ // The class variable is defined either in the current class or
+ // in one of the parent class in the hierarchy.
+ lhs->lhs_class = defcl;
+ lhs->lhs_type = oc_member_type_by_idx(defcl, FALSE,
+ lhs->lhs_classmember_idx);
}
else
{