You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python override of an inherited pure virtual operator() is not generated #146
Observed with cppyy 3.5.0 (cppyy-cling 6.32.8) and cppjit 0.1.0a1 alike on 2026-10-08; the same
Python class shape works when the pure virtual has a plain name. Not cppjit-specific.
importcppyy# or cppjit; identical resultcppyy.cppdef(r'''struct Impl { virtual ~Impl() {} virtual void operator()(int*) = 0; virtual void operator()() = 0; virtual Impl* Clone() = 0; virtual bool IsStandalone() = 0; };struct Standalone : Impl { void operator()(int*) override {} bool IsStandalone() override { return true; } };struct NamedImpl { virtual ~NamedImpl() {} virtual void run() = 0; virtual void other() = 0; };struct NamedMid : NamedImpl { void other() override {} };''')
# works: a pure virtual with a plain name, inherited through an abstract intermediate classtype("A", (cppyy.gbl.NamedMid,), {"run": lambdaself: None})()
# works: both operator() overloads pure in the direct base# fails: pure operator()() inherited through Standalone, which implements the other overloadtype("B", (cppyy.gbl.Standalone,), {"operator()": lambdaself, *a: None, "Clone": lambdaself: self})()
# TypeError: cannot instantiate abstract class '__cppyy_internal::Dispatcher1'
Notes: the override must be registered under the C++ spelling "operator()" (a __call__ method
is not matched); that part is convention, not the defect. The defect is that the generated
dispatcher does not override the inherited pure operator()() when the intermediate base already
overrides operator()(int*), so the dispatcher class stays abstract. BioDynaMo's StandaloneOperationImpl has exactly this shape. Workaround in act3/cartopiax_session.py: a
four-line C++ adapter that spells the pure virtual as Run().
Activity
Override inherited overloads a direct base implements only in part