[bug #68227] multiple inheritance no longer allowed for handle classes
Ray Zimmerman <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
URL:
<https://savannah.gnu.org/bugs/?68227>
Summary: multiple inheritance no longer allowed for handle
classes
Group: GNU Octave
Submitter: rdzman
Submitted: Fri 10 Apr 2026 09:41:36 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Unexpected Error or Warning
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Release: 11.1.0
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 10 Apr 2026 09:41:36 PM UTC By: Ray Zimmerman <rdzman>
A common pattern in my code is to use multiple inheritance with handle
classes. This requires that each parent inherit from *handle* (to avoid the
"cannot mix handle and non-HandleCompatible classes" error), like this:
classdef ffoo < bbar & bbaz
end
classdef bbar < handle
end
classdef bbaz < handle
end
Beginning with Octave 11.1.0, when the object is cleared or goes out of scope,
this results in a warning:
octave:1> f = ffoo(); clear f
warning: error caught while executing handle class delete method:
method delete: conflicting definitions in classes 'bbar' and 'bbaz'
I believe this is related to fixing [https://savannah.gnu.org/bugs/?50011 bug
50011].
MATLAB gives no warning for this case. In Octave, however, there seems to be
no way to turn off the warning, except to turn off *all* warnings.
Because of the incompatibility with MATLAB, I believe this is a bug.
From what I can tell, it seems the only workaround at the moment is to define
a delete() method in each such child class that overrides, then explicitly
calls, *handle*'s delete() method.
classdef ffoo < bbar & bbaz
methods
function delete(obj)
delete@handle(obj);
end
end
end
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68227>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCadlulQAKCRCqLAuaBUf3 TorlAQCZWMmz3FYKPO8tUksNKcvVYrZUf8rZk24EmL3IlTpu1AD/bCMY86q82Ija PMrEXBqOaPEGvzDPp/5tzzYUMNnjYg4= =sYC7 -----END PGP SIGNATURE-----