[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref()
From: |
A.R. Burgers |
Subject: |
[Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods |
Date: |
Thu, 23 Mar 2023 11:16:07 -0400 (EDT) |
Follow-up Comment #11, bug #63841 (project octave):
Unfortunately this approach seems to break something else.
I applied your change.
I changed the class to have a property:
classdef tst_nargout
properties
a_property = 1;
end
methods
function varargout = subsref(obj, s)
fprintf('nargout=%d, s(1).type = %s\n', nargout, s(1).type);
varargout = {nargout, s(1).type, 'arg3'};
end
end
end
and call that class like this from a containers.Map:
m = containers.Map;
cm('first') = tst_nargout;
if cm('first').a_property
true
end
I get this error.
error: subsref: function called with too many outputs
error: called from
subsref
u2 at line 4 column 4
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63841>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63841] nargout is always 0 or 1 for subsref() in classdef methods,
A.R. Burgers <=