1
0
forked from aniani/vim

patch 9.0.1703: Vim9 Calling a method in an extended class fails

Problem: Vim9 Calling a method in an extended class fails
Solution: use method index directly

closes: #12778

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-08-13 17:41:26 +02:00
committed by Christian Brabandt
parent 9ad1bf7afd
commit 74cc13cc40
3 changed files with 44 additions and 0 deletions

View File

@@ -209,6 +209,13 @@ object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl)
siemsg("index %d out of range for interface %s", idx, itf->class_name);
return 0;
}
// If "cl" is the interface or the class that is extended, then the method
// index can be used directly and there is no need to search for the method
// index in one of the child classes.
if (cl == itf)
return idx;
itf2class_T *i2c;
for (i2c = itf->class_itf2class; i2c != NULL; i2c = i2c->i2c_next)
if (i2c->i2c_class == cl && i2c->i2c_is_method == is_method)