patch 9.1.0673: Vim9: too recursive func calls when calling super-class method
Problem: Vim9: too recursive func calls when calling super-class method
with non-overriden super-call methods. (Aliaksei Budavei)
Solution: use interface method, when super is to be used (Ernie Rael)
When compiling "super.Func()" force class context to class that defines
function that is doing "super.Func()".
ISN_METHODCALL arg "cmf_is_super" for specific ufunc.
fixes: #15448
fixes: #15463 (2) super.method may not execute in context of defining
class
closes: #15477
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9.h b/src/vim9.h
index 54938fe..c502ac4 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -238,8 +238,9 @@
// arguments to ISN_METHODCALL
typedef struct {
class_T *cmf_itf; // interface used
- int cmf_idx; // index in "def_functions" for ISN_DCALL
+ int cmf_idx; // index in "def_functions" for ISN_METHODCALL
int cmf_argcount; // number of arguments on top of stack
+ int cmf_is_super; // doing "super.Func", use cmf_itf, not cmf_idx
} cmfunc_T;
// arguments to ISN_PCALL